为什么WinWait()在关闭窗口后返回?

时间:2014-07-02 07:33:42

标签: autoit

$win1 = WinWait("ToBeClosed")
WinClose($win1)
WinWait("ToBeClosed")
MsgBox(0, "", "Here!")

为什么在关闭窗口时会显示此消息框。只要窗口没有再次显示,在WinWait()的第二次调用时停止执行是真的吗?

1 个答案:

答案 0 :(得分:0)

您缺少WinWaitClose

Opt("WinSearchChildren", 1) ;0=no, 1=search children also
Opt("WinTitleMatchMode", 2) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase

$WinTitle = "ToBeClosed"
WinWait($WinTitle)
WinClose($WinTitle)
WinWaitClose($WinTitle)
WinWait($WinTitle)
MsgBox(0, "", "Here!")