首页 > 解决方案 > #IfWinActive / #ifWinExist 在 ahk 中未按预期工作

问题描述

#IfWinActive ahk_class Notepad
^!c::MsgBox You pressed Control+Alt+C in Notepad.
#IfWinActive ahk_class WordPadClass
^!c::MsgBox You pressed Control+Alt+C in WordPad.
#IfWinActive
^!c::MsgBox You pressed Control+Alt+C in a window other than Notepad/WordPad.

按预期工作,但是当我尝试下面的代码时...消息框没有出现

#IfWinActive ahk_class Notepad
!c::MsgBox You pressed Alt+C in Notepad.
#IfWinActive ahk_class WordPadClass
^!c::MsgBox You pressed Control+Alt+C in WordPad.
#IfWinActive
^!c::MsgBox You pressed Control+Alt+C in a window other than Notepad/WordPad.

我只是不知道为什么它不起作用

标签: autohotkeyhotkeys

解决方案


推荐阅读