Go Back   CodingForums.com > :: Computing & Sciences > Computer Programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-18-2009, 10:36 PM   PM User | #1
nikee
Regular Coder

 
Join Date: Jan 2009
Posts: 173
Thanks: 5
Thanked 12 Times in 11 Posts
nikee is an unknown quantity at this point
Lightbulb Program idea/request: change opacity of another running process to 0%?

Hey.

I know this isn't a forum where users can post program requests etc. on. But i would really appreciate if someone here could help me out for just a few minutes, i don't think this will be too hard.

My idea is, as it says in the title, to make a small program (that also runs invisible) that will keep checking if a certain process is running (maybe a timer?) and if it is, set the opacity of the program to 0%. And if you can, also mute it from sounds and remove the icon from the taskbar.

I do know a little bit of programming, but unfortunately, it's not enough to make a program like this.

If it's possible, i would appreciate if it is coded in Visual Basic 6, since i know a little bit of it. (and if i need to change anything, it's easier then..)

Of course you don't have to help me, but i would really appreciate it.

I wish i could pay you back somehow, but i unfortunately can't send you money. (don't know how, and don't currently have very much :P) If you need help with anything though, just ask!
Thanks in advance.
-Nike
nikee is offline   Reply With Quote
Old 07-19-2009, 01:05 PM   PM User | #2
Amphiluke
Regular Coder

 
Amphiluke's Avatar
 
Join Date: Jul 2009
Posts: 312
Thanks: 3
Thanked 89 Times in 89 Posts
Amphiluke is on a distinguished road
I code in Delphi rather than in Visual Basic, and so, AFAIK it is possible to change opacity of another window with use of function SetLayeredWindowAttributes. Just google about it.
What is more, one shoud change an attribute of the specified window (namely add 0x00080000 to an extended window style) to allow opacity effects.

But why not completely hide that window by means of Win32 API? The effect will be the same...
__________________
I am still learning English
Amphiluke is offline   Reply With Quote
Old 07-19-2009, 02:52 PM   PM User | #3
nikee
Regular Coder

 
Join Date: Jan 2009
Posts: 173
Thanks: 5
Thanked 12 Times in 11 Posts
nikee is an unknown quantity at this point
Thanks.

I don't know anything at all about delphi

If i hide that window instead of changing the opacity, will the program still be running? Or will it exit?
And is there a way to hide the program from the taskbar/tray and mute it from all sounds?

The reason i asked for someone to do it for me is because i have no idea on how to accomplish a program like this...

Could you maybe.... do it for me? I would appreciate it soo much!
nikee is offline   Reply With Quote
Old 07-19-2009, 03:35 PM   PM User | #4
Amphiluke
Regular Coder

 
Amphiluke's Avatar
 
Join Date: Jul 2009
Posts: 312
Thanks: 3
Thanked 89 Times in 89 Posts
Amphiluke is on a distinguished road
Hidding the window does not terminate the program.
Yes, it is possible to hide a taskbar icon completely.
In Delphi, it is easy enough, if you know the caption of the window to hide:
Code:
program Project1;

uses
  Windows;

var
  Wnd: HWND;
  Evnt: Cardinal;

const
  WndCaption = 'Untitled - Notepad'; // Notepad as an example

begin

  while True do
  begin
    Wnd := FindWindow(nil, @WndCaption[1]);
    if Wnd <> 0 then
      if IsWindowVisible(Wnd) then ShowWindow(Wnd, SW_HIDE);
    Evnt := CreateEvent(nil, True, False, nil);
    WaitForSingleObject(Evnt, 500);
    CloseHandle(Evnt);
  end;

end.
This program hides Notepad windows right away when the Notepad starts.
__________________
I am still learning English

Last edited by Amphiluke; 07-19-2009 at 03:41 PM.. Reason: Grammar revised
Amphiluke is offline   Reply With Quote
Old 07-19-2009, 05:04 PM   PM User | #5
nikee
Regular Coder

 
Join Date: Jan 2009
Posts: 173
Thanks: 5
Thanked 12 Times in 11 Posts
nikee is an unknown quantity at this point
Awesome dude, awesome!

So now you're using the caption instead of the process name to track the program? What happens if the program changes caption then? Will it still work?

And... since i've never used delphi, how do i compile the code to a program? Where can i find a compiler for that?

Thanks again.
nikee is offline   Reply With Quote
Old 07-19-2009, 06:20 PM   PM User | #6
Amphiluke
Regular Coder

 
Amphiluke's Avatar
 
Join Date: Jul 2009
Posts: 312
Thanks: 3
Thanked 89 Times in 89 Posts
Amphiluke is on a distinguished road
If the caption is not known a priori, you can get a process by its executable file name. But it is more difficult. For details see http://.

Delphi programming environment is not freeware, but you can get a lite version, which is free. http://. (To moderators: I post this reference without any advertising considerations and I'll remove it if need be...)
__________________
I am still learning English

Last edited by Amphiluke; 07-19-2009 at 06:26 PM..
Amphiluke is offline   Reply With Quote
Old 07-19-2009, 08:50 PM   PM User | #7
nikee
Regular Coder

 
Join Date: Jan 2009
Posts: 173
Thanks: 5
Thanked 12 Times in 11 Posts
nikee is an unknown quantity at this point
Alright. I finally got it installed, but i have no idea what kind of new project i want to start, where in the code page i'm suppose to paste the code or how to actually compile it to an exe file.

I'm sorry, but it's just to blurry for me.

If you could do me one last favor and actually compile it to an exe file, that would be awesome!

The title of the program i want to hide is "TeamViewer" and the process is "TeamViewer.exe"

I'm sorry if i'm disturbing..

Yet again; thanks a bunch!
nikee is offline   Reply With Quote
Old 07-19-2009, 11:04 PM   PM User | #8
Dunna
Regular Coder

 
Join Date: May 2004
Location: New Hampshire, America
Posts: 245
Thanks: 0
Thanked 2 Times in 2 Posts
Dunna is an unknown quantity at this point
Use the caption to find the program's PID, then store that as it won't change but the caption could. Then use ShowWindow(SW_HIDE) like a previous user said. That will also remove it from the taskbar. I believe the other functions you need are FindWindow() and GetPID() or something similar, check MSDN.

I made the same program when I was in high school to hide my internet browsing.
Dunna is offline   Reply With Quote
Old 07-20-2009, 02:15 PM   PM User | #9
Amphiluke
Regular Coder

 
Amphiluke's Avatar
 
Join Date: Jul 2009
Posts: 312
Thanks: 3
Thanked 89 Times in 89 Posts
Amphiluke is on a distinguished road
Attachment 7600
nikee: Once you'll start this program, all the windows of the TeamViewer.exe process will be hidden. Moreover, if you'll start another instance of TeamViewer.exe, its window will also be hidden. To terminate the program, kill its process (AntiTeamViewer.exe) in Task manager processes list.
__________________
I am still learning English

Last edited by Amphiluke; 01-03-2012 at 07:39 AM..
Amphiluke is offline   Reply With Quote
Old 07-22-2009, 05:44 AM   PM User | #10
nikee
Regular Coder

 
Join Date: Jan 2009
Posts: 173
Thanks: 5
Thanked 12 Times in 11 Posts
nikee is an unknown quantity at this point
First off, sorry for the late response.

Thank you soo much for helping me out now (including you Dunna), i appreciate it a lot.

I will try the program later today when i get back home, or maybe tomorrow. (i'm going away for the day and will get back home pretty late)

nikee is offline   Reply With Quote
Old 07-23-2009, 12:51 PM   PM User | #11
nikee
Regular Coder

 
Join Date: Jan 2009
Posts: 173
Thanks: 5
Thanked 12 Times in 11 Posts
nikee is an unknown quantity at this point
I've tried it now. It works great, just what i wanted...

But, there is one more thing that i want it to do (if it's possible)... and that is to hide the icon in the system tray. Cause if i open teamviewer and then the hide program, i will still see the teamviewer icon in the tray. And if i click it, the teamviewer window pop's up for like a half second or so and then it hides again.

If it doesn't work, i'll have to figure out another way to hide it. Thanks a lot
nikee is offline   Reply With Quote
Old 07-23-2009, 02:16 PM   PM User | #12
Amphiluke
Regular Coder

 
Amphiluke's Avatar
 
Join Date: Jul 2009
Posts: 312
Thanks: 3
Thanked 89 Times in 89 Posts
Amphiluke is on a distinguished road
I should like to cease working on this program. This is because as soon as I added the code for deleting an icon tray, my antivirus immediately recognized it as a trojan program. I do not want to pass for a virus writer.
__________________
I am still learning English
Amphiluke is offline   Reply With Quote
Old 07-23-2009, 02:36 PM   PM User | #13
nikee
Regular Coder

 
Join Date: Jan 2009
Posts: 173
Thanks: 5
Thanked 12 Times in 11 Posts
nikee is an unknown quantity at this point
I obviously don't want any AV to detect it as a trojan. I understand you.

Thanks a lot for the help. I appreciate it very much!
nikee is offline   Reply With Quote
Old 07-27-2009, 05:19 PM   PM User | #14
nikee
Regular Coder

 
Join Date: Jan 2009
Posts: 173
Thanks: 5
Thanked 12 Times in 11 Posts
nikee is an unknown quantity at this point
Question Alternative to overflow:hidden?

wops, sorry about this message, didn't mean to post it ^^
nikee is offline   Reply With Quote
Reply

Bookmarks

Tags
idea, program, request

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:13 AM.


Advertisement
Log in to turn off these ads.