Hi,
How do I focus on a hidden window without that window becoming visible? I've read th post here which almost does what I'm looking for:
http://www.mjtnet.com/forum/viewtopic.p ... hidewindow
but this method for hiding the winodw takes long enough that it is noticable to the user.
Any help would be greatly appreciated.
SetFocus to a hidden window without revealing the window
Moderators: JRL, Dorian (MJT support)
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
That's not possible. Focus means making the window able to accept keyboard input. Therefore a focused window must be visible.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Technically Marcus is correct but as a practical matter if the windows transparency is set to "1", the window is technically visible but still does not show up on the screen.
HERE is a sample of doing exactly that. Setting the window's transparency/opacity to one then setting focus to the window.
HERE is a sample of doing exactly that. Setting the window's transparency/opacity to one then setting focus to the window.
Thanks for your response but I already have code which makes the window hidden and allows me to send input to it (based on the post I mentioned):
My problem is not that I can't make a hidden window accept input. My problem is that I can't make the window hidden fast enough.
Code: Select all
Let>HWND_TOPMOST=-1
Let>HWND_NOTOPMOST=-2
Let>HWND_BOTTOM=1
Let>SWP_NOSIZE=1
Let>SWP_NOMOVE=2
Let>SWP_NOACTIVATE=16
Let>SWP_SHOWWINDOW=64
Let>SWP_HIDEWINDOW=128
Let>Flags={%SWP_HIDEWINDOW% Or %SWP_NOACTIVATE% Or %SWP_NOSIZE% Or %SWP_NOMOVE%}
GetWindowHandle>Settings*,winhandle
LibFunc>User32,SetWindowPos,swpr,winhandle,HWND_BOTTOM,0,0,0,0,Flags
wait>1
Press ALT
Send Character/Text>f
Release ALT