AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Hiding a window from a process

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Hidden
Guest





PostPosted: Fri Jan 04, 2008 3:55 pm    Post subject: Hiding a window from a process Reply with quote

I was wondering if it's possible to make all windows appearing from a certain process either hidden or invisible (transparent) directly without having to wait for the window to appear first and then hide it or make it invisible. This is because I want to avoid having the window flash on the screen before getting hidden or invisible. Is this possible and if so how should I do it?

If not do anyone have any idea how to hide or make a window invisible without having it flash on the screen before getting hidden or invisible? Thanks
Back to top
aaffe



Joined: 17 May 2007
Posts: 66

PostPosted: Fri Jan 04, 2008 3:58 pm    Post subject: Reply with quote

If you use the command
Run, ...
to open a cmd-window and you want to hide this, you can use
run, programm, ,HIDE
Back to top
View user's profile Send private message
Hidden
Guest





PostPosted: Fri Jan 04, 2008 4:38 pm    Post subject: Reply with quote

I was not aware of that option and for a second there I thought the answer was in front of me all the time, but unfortunately that didn't work. I think the reason is because the application itself does not have a gui, but it gives a couple of message boxes and I would like them to start hidden or invisible. Any other idea?
Back to top
engunneer



Joined: 30 Aug 2005
Posts: 6772
Location: Pacific Northwest, US

PostPosted: Fri Jan 04, 2008 6:14 pm    Post subject: Reply with quote

you would have to hook the shell window creation process. I think majkinetor or another hook expert has demonstrated this in the forum.
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
Hidden
Guest





PostPosted: Fri Jan 04, 2008 10:05 pm    Post subject: Reply with quote

Thank you for your help, you gave me a push in the right direction and now I have almost done it. The problem is that I would like it to just affect the windows created by the process in particular and I can not manage to do that for some reason. It seems that if I add a variable inside the ShellMessage function it is blank even if it has a value outside the ShellMessage function. The closest I have come to is having all the windows created by the process and my script affected by the ShellMessage function, which means that even the msgbox created at the end by the script (not the process which has ended by this time) is hidden. Currently I am using ahk_id %lParam% as identifier to which windows should be hidden. Any ideas on how I might be able to fix this?
Back to top
engunneer



Joined: 30 Aug 2005
Posts: 6772
Location: Pacific Northwest, US

PostPosted: Fri Jan 04, 2008 10:44 pm    Post subject: Reply with quote

post your code. you may be using variables wrong or have a variable scope issue.
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
Hidden
Guest





PostPosted: Sat Jan 05, 2008 3:16 am    Post subject: Reply with quote

I managed to fix the problem when I found out how to use a variable from outside inside the ShellMessage function. I did this by writing Global MyVar before starting to use the variable. Now I have another problem, sending WinHide through ShellMessage makes the window itself disappear, but not the entry on the taskbar, which is very weird because sending the WinHide command to the same window without using ShellMessage hides the entry on the taskbar too. Any ideas?
Back to top
engunneer



Joined: 30 Aug 2005
Posts: 6772
Location: Pacific Northwest, US

PostPosted: Sat Jan 05, 2008 5:17 am    Post subject: Reply with quote

hide teh window via the shell, then the ahk command? not perfect, but maybe better than WinHide alone.

maybe there is another hook in the taskbar you can use?
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
Hidden
Guest





PostPosted: Sun Jan 06, 2008 2:52 am    Post subject: Reply with quote

Thanks for the help. Such an easy idea why didn't I think of that, I could just run WinHide through the ShellMessage and outside it. Unfortunately it made no difference, once it was hidden through the ShellMessage it remained as an entry on the taskbar no matter what I did. Also after some more searching I came by this page http://www.autohotkey.com/forum/topic6705.html which seemed to be about something very similar but found out very quickly after trying it out some that the problem I had was another and that the code there wasn't much help for me.

Now I found out that for some reason sending commands to a hidden window when it is hidden through the ShellMessage command was not very reliable, most of the time the window didn't receive the command at all and yes I did have DetectHiddenWindows On. So therefore I will come up with a different way to solve the problem I have without having to hide the windows. Though still I wonder how other people more experienced with shell hooking would have solved this problem. Maybe send a fake shell destroy command to the taskbar to kill the entry without killing the window itself?
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group