#IfWinActive ahk_class Notepad
LButton::
Click Down
WinGetActiveTitle, Title
IfInString, Title, 记事本
{
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
{
Send ^s
Sleep 588
WinMinimize, A
}
Click Up
return
#IfWinActive