AutoIt WinWait Function
Function to pause the execution of the script until a specified window exists.
3111 views

Edited: 2021-02-14 01:53
The WinWait function can be used to make the script pause, until a specified window opens. Useful if the execution of your script depends on a specific program running.
The check is performed around every 250 milliseconds.
The following script will wait for 20 seconds, to see if notepad opens, and close it if it dose, but exit if it doesn't.
Run("notepad.exe")
WinWait("[CLASS:Notepad]", "", 10)
sleep(5000)
WinClose("[CLASS:Notepad]")
Parameters
title | Title, hWnd or class of the window to check. |
text | Optional. Text to check for. |
timeout | Optional. The timeout is in seconds. |
Tell us what you think: