Aeowon Posted July 7, 2009 Posted July 7, 2009 (edited) This is my first application so, be gentle. I just cannot figure out how for the life of me, how to tie the 'Hotkey' to a func or whatever it needs to be in order to Close the Current Window/Process. I want it to Kill the process by pressing a button on the keyboard and also stay open so that I could use the hotkey to close other applications(loop). Rewrite the code if you have to.. give me pointers. I'm just trying to learn. Is there a book I can buy to learn this stuff? I'm a technology hobbyist and I'm dipping my foot into this territory and heard this is a good way to learn. Thank you. HotKeySet("{f5}", "close") Global $ON = False ;close func Func close() $ON = True EndFunc if $ON = True then WinClose( "{ACTIVE}" ) endif Edited July 7, 2009 by Aeowon
darkmaster071 Posted July 7, 2009 Posted July 7, 2009 (edited) Here. Ow and the best way to learn is to read the helpfile(F1), it should be your best friend when coding in autoit HotKeySet("{F11}", "close") While 1 Sleep(10) WEnd ;close func Func close() WinClose("[ACTIVE]", "") EndFunc Edited July 7, 2009 by darkmaster071
Aeowon Posted July 8, 2009 Author Posted July 8, 2009 Thank you darkmaster071 for the quick response and rewritten code. I'll get to reading now :] Thanks again.
herewasplato Posted July 8, 2009 Posted July 8, 2009 ... Close the Current Window/Process. ...You might try Alt-F4 instead of a script... but that is not a bad script to learn from.Welcome to the forum. [size="1"][font="Arial"].[u].[/u][/font][/size]
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now