使用AutoIt检查窗口是否具有焦点

时间:2016-08-24 15:14:19

标签: autoit

我想知道是否可以检查窗口是否在AutoIt中有焦点。我检查过并没有找到太多。我尝试过使用WinSetOnTop,但这似乎没有做任何事情,所以我考虑使用WinActivate,但这似乎没有做我需要的。

我想这样做的原因是因为我有这个应用程序我正在写作恶作剧,我不希望我正在玩恶作剧的同事在它自动启动时忽略窗口。我想在启动文件夹中放置一个快捷方式,我们有几个应用程序在启动时运行,因此我希望我的用户要么总是在顶部,要么在用户试图忽略应用程序时大声喊出粗鲁的话。 / p>

这是否可能,如果是的话,你可以帮助我,因为我没有想法。

1 个答案:

答案 0 :(得分:2)

无论您的动机如何,您都可以尝试WinWaitActive

语法:

foreach (glob("$parent_folder/*") as $file) { 
$lastmoddate = filemtime("$file");
... folder creation/checking and file moving stuff ...
}

可能有用的示例:

<li class="progress">
<?php $total = 100; ?>  
<?php $star = 4; ?>  
<?php $number = ($total / $star); ?>    
<div class="progress-bar" data-width="<?php echo $number; ?>">
</div>
</li>

参考:
https://www.autoitscript.com/autoit3/docs/functions/WinWaitActive.htm

相关问题