bennyvo 0 Posted March 1, 2005 hi, I want to press a key and it close an active program. let say i run the script then open notepad, when i press ESC key, i want it to close notepad. anyone know the code thanks... Share this post Link to post Share on other sites
Insolence 2 Posted March 1, 2005 This would be fairly simple, I believe. Where are you having trouble? First you assign the hotkey, and wait for the user to press it. You have to get the process ID via the active window title and then close it. "I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar. Share this post Link to post Share on other sites
bennyvo 0 Posted March 1, 2005 WinWaitActive("Untitled - Notepad") HotKeySet("{ESC}", "Close") While 1 Sleep(100) WEnd Func Close() WinClose("Untitled - Notepad", "") EndFunc i think i found my solution Share this post Link to post Share on other sites