Skip to content

Instantly share code, notes, and snippets.

@misodengaku
Created March 22, 2016 05:53
Show Gist options
  • Save misodengaku/b3cf3c44a92c95f3b684 to your computer and use it in GitHub Desktop.
Save misodengaku/b3cf3c44a92c95f3b684 to your computer and use it in GitHub Desktop.
#uselib "user32"
#cfunc FindWindow "FindWindowA" int, str
#func keybd_event "keybd_event" int, int, int, int
#func SetForegroundWindow "SetForegroundWindow" int
repeat
h = FindWindow(0, "PuTTY Fatal Error")
if h = 0: break
SetForegroundWindow h
keybd_event 13, 0, 0, 0 // Enter keydown
keybd_event 13, 0, 2, 0 // Enter keyup
mes h
wait 1
loop
repeat
h = FindWindow(0, "PuTTY (inactive)")
if h = 0: break
SetForegroundWindow h
keybd_event 18, 0, 0, 0 // Alt keydown
keybd_event 115, 0, 0, 0 // F4 keydown
keybd_event 115, 0, 2, 0 // F4 keyup
keybd_event 18, 0, 2, 0 // Alt keyup
mes h
wait 1
loop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment