答案1
这是我根据问题中的编辑使用的代码。
WatchWin = GUIwin ; Window Title to watch.
CoordMode, Mouse, Screen
GUI, Show, w200 h200, GUIwin
SetTimer, WatchMouse, 10
Return
WatchMouse:
WinGet, WinHWD, ID, % WatchWin
MouseGetPos,,, mPosHWD,, 1
WinSet, Trans, % ( mPosHWD = WinHWD ? 150 : 255 ), GUIwin
Return
ESC::ExitApp ; <-- Press escape to exit.