By using this site you agree to the use of cookies by Brugbart and our partners.

Learn more

AutoIt WinWait Function

Function to pause the execution of the script until a specified window exists.

Edited: 2015-01-15 22:05

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.


titleTitle, hWnd or class of the window to check.
textOptional. Text to check for.
timeoutOptional. The timeout is in seconds.

WinWait Example

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.


WinWait("[CLASS:Notepad]", "", 10)