WinWaitActive
From AutoIt Wiki
Waits to run script on lines after the WinWaitActive Function until the specified window pops up on the screen
WinWaitActive ( "title" [, "text" [, timeout]] )
[] - > The brackets mean that the parameter does not need to have an entry in order for the function to execute
Parameters
title -> You have to get the title of the window with AU3Info on the tools menu. The title must be enclosed in double quotes
text -> Text to check in the window
timeout -> How many seconds before a 'Timeout' occurs. A Timeout will stop the code from running
A value can be retrieved from this function to find out if it executed correctly or not
A value of 1 means everything's OK A value of 0 means that the window you wanted to come up didn't appear in time
Also see these other functions
WinActive, WinExists, WinWait, WinWaitClose, WinWaitNotActive, WinWaitDelay (Option)
Example:
WinWaitActive("Windows Security") ; Wait for Windows Mail Login Box to Pop Up
WinWaitActive("Windows Security", "",40) ; If the Windows Mail Security box doesn't pop up in 40 seconds, then a timeout occurs