" IfWinActive"之间的区别和"如果是WinActive()"

时间:2016-01-11 22:41:31

标签: autohotkey

有人可以解释IfWinActiveIf WinActive()之间的区别吗?我真的很想知道,但谷歌和官方的AutoHotkey文档都没有提及。

1 个答案:

答案 0 :(得分:1)

如果public ActionResult Create(string[] UserProps) { PropsController pc = new PropsController(); foreach (string prop in UserProps) { pc.Create(new Prop(prop.ToLower())); // or whatever your constructor is } } 的计算结果为True,则执行下一行代码(或括号括起的代码块),如果为False,则跳过它。所有这一切都是评估为真或假。

如果活动窗口符合指定条件,则函数IfWinActive将返回活动窗口的唯一ID(HWND)。如果没有,则函数返回0.由于所有非零数字都被视为“true”,因此只要“WinTitle”处于活动状态,语句WinActive()就为真,然后就像If WinActive("WinTitle")一样。注意函数中的引号,但不是指令。