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

标签 windows wait autoit

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

相关文章:

C++等待问题

windows - 拖放操作调用的 vbscript 中的当前工作目录

c++ - 使用 node-gyp 编译时 CFLAGS 在 Windows 上不起作用

php - 从 php-cli 访问剪贴板?

vb.net - 等待单元引发事件

javascript - javascript 变量上的 Nightmare.js wait()

python - 在 Windows 中使用 python 获取 ipconfig 结果

stdout - 同时捕获和显示 STDOUT

Java 与 AutoIt 和 Jacob 库

shell - 批处理 : start application doesn't show a GUI