我试过这个,但没有用: ; ..................................................... .......... 1个例子:
If not WinExist("QTranslate") ; "QTranslate" this is the title of
the window "y" that has the same class of "x"
{
Loop {
WinWaitActive, ahk_class #32770 ; this is the class of the
window("x")
WinSet,AlwaysOnTop,On, ahk_class #32770
WinWaitClose, ahk_class #32770
}
}
Return
; ..................................................... .......... 示例 2:
#If not WinActive("QTranslate") and WinExist("ahk_class #32770") ; close error win
RButton::
AppsKey::
Loop, 3{
Winclose,ahk_class #32770 ; this is the class of the window("x")
}
#If
在 WinTitle 参数中,您可以指定多个标准 用于缩小特定窗口的搜索范围。参见多重标准。
例如
If !WinExist("QTranslate ahk_exe QTranslate.exe") ; "!" means "NOT"
或
If !WinExist("QTranslate ahk_exe QTranslate.exe", "WinText")
或
If !WinExist("QTranslate ahk_exe QTranslate.exe", "WinText", "ExcludeTitlePart")
使用 AHK 附带的 Window Spy 工具来获取您需要的正确信息。