Jump to content
Sign in to follow this  
leuce

How to capture *and* let through Alt+Tab?

Recommended Posts

leuce

G'day everyone

I want users of my script to be able to change windows using Alt+Tab, but I also want the script to perform a function when the user presses Alt+Tab. How can I do it?

HotKeySet ("!{TAB}", "AltTab")

While 1
Sleep ("100")
WEnd

Func AltTab()
Send ("!{TAB}")
DO SOMETHING ELSE ALSO
EndFunc

The above does not work. It sends Alt+Tab but it does not activate the window changer that is normally associated with Alt+Tab. Alternatively, if that window changer has a name (in Windows XP or elsewhere) and I can "run" it, can anyone tell me how to do it?

Thanks

Samuel

Share this post


Link to post
Share on other sites
somdcomputerguy

Try the function coded like this. It disables the hotkey, sends the keystroke again, then sets the hotkey back to the way it was.

Func AltTab()
 HotKeySet("!{TAB}")
 Send("!{TAB}")
 ;DO SOMETHING ELSE ALSO
 HotKeySet ("!{TAB}", "AltTab")
EndFunc
Edited by somdcomputerguy

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.