urmommie Posted April 14, 2009 Share Posted April 14, 2009 well I read the tuts and all but I just can't get it well lets say this is my script: $answer = msgbox(4, "Title", "Do you want to open?") If $answer = 6 Then Run("mspaint.exe") EndIf If $answer = 7 Then Exit EndIf And I wanted to make it like this: $answer = msgbox(4, "Title", "Do you want to open?") If $answer = 6 Then Run("mspaint.exe") HotKeySet("{Esc}", "Exit"); this way the person can exit notepad by just pressing esc please help EndIf If $answer = 7 Then Exit EndIf Link to comment Share on other sites More sharing options...
Authenticity Posted April 14, 2009 Share Posted April 14, 2009 Look here to see how to get a window handle from PID.You can do something like (read the help file if something isn't clear):HotKeySet("{ESC}", "_ShutdownMSPaint") HotKeySet("{SPACE}", "_EXIT") . . . If $Answer = 6 Then ; Yes $PID = Run('mspaint.exe') $hwnd = _GetHwndFromPID($PID) Else Exit EndIf While 1 Sleep(50) WEnd Func _EXIT() Exit EndFunc Func _ShutdownMSPaint() WinClose($hwnd) EndFunc Link to comment Share on other sites More sharing options...
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