Skip to content

Instantly share code, notes, and snippets.

@dufferzafar
Created September 10, 2013 14:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dufferzafar/6510242 to your computer and use it in GitHub Desktop.
Save dufferzafar/6510242 to your computer and use it in GitHub Desktop.
Hijack Windows Close Button
Gui, Show, w400 h300, Demo Window
OnMessage(0x112, "WM_SYSCOMMAND")
Return
WM_SYSCOMMAND(wParam)
{
if (A_Gui = 1 && wParam = 0xF060) ; SC_CLOSE
{
MsgBox Nope. ; Optional ;)
return 0
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment