检查 WinList() 是否包含某个标题 [英] Check if WinList() contains a certain title

查看:35
本文介绍了检查 WinList() 是否包含某个标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 WinList()在AutoIt中获取窗口标题和句柄.

I am listing all open windows using WinList() to get window title and -handle in AutoIt.

我想检查结果数组是否包含特定标题.做这个的最好方式是什么?没有 WinList().Contains("TitleName") 或类似的东西.

I want to check if resulting array contains a specific title. What is the best way to do this? There is no WinList().Contains("TitleName") or something like that.

Local $aList = WinList()    ;Gets a list of Window Titles and IDs

推荐答案

好的,我现在知道了:

For $i = 1 To $aList[0][0]
    If $aList[$i][0] = "Title/String you search for" Then
        MsgBox($MB_SYSTEMMODAL, "", "MessageBox shows this text if title is in list.")
    EndIf
Next

这篇关于检查 WinList() 是否包含某个标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆