Syntax
WaitForWindowClose
[Caption="<caption>" | Handle=<hwnd>]
[Class="<class>"]
[Timeout=<secs>]
[Exclude=<handlelist>]Description
Wait for a window to disappear from the screen.Parameters
Caption="<caption>"
- The window's title bar text. This parameter, together with the optional Class parameter is used to identify the window. If the last character of the caption is an asterisk (*), then the search is for a window whose title bar text begins with the characters preceeding the asterisk. If the first character of the caption is an asterisk, then the search is for a window whose title bar text ends with the characters after the asterisk. If the first and last characters are both asterisks, the search is for a window whose title bar text contains the text between the asterisks. Either Caption or Handle must be supplied.
Handle=<hwnd>
- The window handle of the window. The window handle must have been obtained from a previous SetWindow or WaitForWindow statement's Result. Use of this parameter instead of Caption (and Class) results in much faster processing of the statement. Either Caption or Handle must be supplied.
Class="<class>"
- Optional. The window class of the window. This parameter is used to further refine the window search. This is useful for example when an application's pop-up dialog box has the same title as the application main window. The Class parameter is included automatically by the recorder.
Timeout=<secs>
- Optional. The period in seconds after which execution of the script will continue regardless of whether the window has disappeared. If a timeout occurs, the variableTimedOut is set toTrue. Otherwise, it is set toFalse. If the Timeout parameter is not specified, the TimedOut variable's value is not modified. A timeout value of zero causes an immediate timeout if the window is visible.
Exclude=<handlelist>
- Optional. This parameter specifies a list (a CSV list) of window handles that are to be ignored in the search for a matching window. These handles must have been obtained in an earlier SetWindow, WaitForWindow, ChildWindows, or other call that returns a window handle.
Remarks
Example
WaitForWindowClose Caption="Notepad*"Wait for the Notepad to exit.