指定窗口下激活脚本的使用方法集合
; 例 1 IfWinExist, Untitled - Notepad { WinActivate ; 自动使用上面找到的窗口. WinMaximize ; 同上 Send, Some text.{Enter} return } ; 例 2 IfWinNotExist, Calculator return else { WinActivate ; 前面的"IfWinNotExist"也设置了上次找到的窗口. WinMove, 40, 40 ; 把它移动到新位置. return } ; 例 3 if WinExist("ahk_class Notepad") or WinExist("ahk_class" . ClassName) WinActivate ; 使用最近找到的窗口. MsgBox % "The active window's ID is " . WinExist("A") ; 例 4: 等同于 IfWinNotExist, Calculator If !WinExist("Calculator") return