autohotkey: #IfWinActive 如何同时指定 ahk_class 和 ahk_exe

qea*_*tzy 6 autohotkey

在 autohotkey 的#IfWinActive声明中,是否可以指定多个条件?具体来说,ahk_classahk_exe?例如,类似于

#IfWinActive ahk_exe test.exe && ahk_class Test
; window specific stuff
#IfWinActive ; Test
Run Code Online (Sandbox Code Playgroud)

Rel*_*lax 6

在 WinTitle 参数中,您可以指定多个标准来缩小特定窗口的搜索范围。请参阅多个标准

#IfWinActive ahk_exe test.exe ahk_class Test

    ; window specific definition of hotkeys or/and hotstrings

#IfWinActive ; turn off context sensitivity
Run Code Online (Sandbox Code Playgroud)

https://autohotkey.com/docs/commands/_IfWinActive.htm

F1::
    IfWinActive ahk_exe test.exe ahk_class Test
    ; do window specific stuff
return
Run Code Online (Sandbox Code Playgroud)

https://autohotkey.com/docs/commands/WinActive.htm