简体   繁体   English

“ IfWinActive”和“ If WinActive()”之间的区别

[英]Difference between “IfWinActive” and “If WinActive()”

Can anybody explain the difference between IfWinActive and If WinActive() ? 谁能解释IfWinActiveIf WinActive()之间的区别? I'm really wondering, but Google and official AutoHotkey docs says nothing about. 我真的很想知道,但是Google和官方的AutoHotkey文档什么也没说。

If IfWinActive evaluates to True, the next line of code (or brace-bracketed code block) is performed, or if False, it is skipped. 如果IfWinActive评估为True,则执行下一行代码(或用括号括起来的代码块),如果为False,则跳过该行。 All it does is evaluate to True or False. 它所做的全部是将结果评估为True或False。

The function WinActive() returns the Unique ID (HWND) of the active window if it matches the specified criteria. 如果函数WinActive()与指定条件匹配,则返回活动窗口的唯一ID(HWND)。 If it does not, the function returns 0. Since all non-zero numbers are seen as "true", the statement If WinActive("WinTitle") is true whenever "WinTitle" is active, and then acts just like IfWinActive WinTitle . 如果不是,则该函数返回0。由于所有非零数字都被视为“ true”,因此,只要“ WinTitle”处于活动状态,语句If WinActive("WinTitle")为true,然后就像IfWinActive WinTitle一样IfWinActive WinTitle Note the quotes in the function, but not the directive. 请注意函数中的引号,而不要注意指令。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM