gpt4 book ai didi

windows - 如何在 AutoIt 中同时 Winwait 两个窗口?

转载 作者:可可西里 更新时间:2023-11-01 13:28:28 24 4
gpt4 key购买 nike

我想知道是否可以同时为 WindowWithThisTitleWindowWithThatTitle WinWaitActive。我正在执行命令,可能会出现一个窗口,告诉我连接失败或出现用户/密码对话框。

还有其他方法吗?

WinWaitActive("Title1", "", 5)
If(WinExists("Title1")) Then
MsgBox(0, "", "Do something")
Else
If(WinExists("Title2")) Then
MsgBox(0, "", "Do something else")
EndIf
EndIf

因为我不想超过 15 秒的超时。

最佳答案

一个更简单的解决方案可能是在您的 WinWaitActive 中使用正则表达式标题,如定义 here

然后你会得到这样的东西:

$hWnd = WinWaitActive("[REGEXPTITLE:(WindowWithThisTitle|WindowWithThatTitle)]")

If WinGetTitle($hWnd) = "WindowWithThisTitle" then
DoSomething()
Else
DoSomethingElse()
EndIf

关于windows - 如何在 AutoIt 中同时 Winwait 两个窗口?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3481399/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com