MisterZakary
1/8/2018 - 5:55 PM

AHK:禁止关闭按钮关闭时最小化当前窗口

AHK:禁止关闭按钮关闭时最小化当前窗口

#IfWinActive ahk_class Notepad2U
LButton::
Click Down
IfWinNotActive ahk_class Notepad2U
{
   KeyWait LButton
   Click Up
}
return

LButton Up::
CoordMode, Mouse, Screen
MouseGetPos, x, y
SendMessage, 0x84,, (x & 0xFFFF) | (y & 0xFFFF) << 16  ; WM_NCHITTEST
if (ErrorLevel = 20) ; close button
   WinMinimize, A
Click Up
return