我想知道是否可以同时为 WindowWithThisTitle
和 WindowWithThatTitle
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/