Core Function WinWait

From Sputnik Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "<pre> WinWait ( <title>, <text>, <timeout> ) </pre> === Description === Waits until the requested window exists. === Parameters === ==== Title ==== The title of the window. ...")
 
(Return Value)
Line 23: Line 23:
 
=== Return Value ===
 
=== Return Value ===
  
None.
+
Success: Returns 1.
 +
 
 +
Failure: Returns 0 if timeout occurred.
  
 
=== Remarks ===
 
=== Remarks ===

Revision as of 20:28, 29 November 2011

WinWait ( <title>, <text>, <timeout> )

Contents

Description

Waits until the requested window exists.

Parameters

Title

The title of the window.

Text

Optional; The text of the window to read.

Timeout

Optional; Timeout in seconds.

Return Value

Success: Returns 1.

Failure: Returns 0 if timeout occurred.

Remarks

The difference between this function and WinClose is that WinKill will forcibly terminate the window if it doesn't close quickly enough. Consequently, a user might not have time to respond to dialogs prompting the user to save data.

Although WinKill can work on both minimized and hidden windows, some windows (notably Windows Explorer) can only be terminated using WinClose.

See "WinTitleMatchMode" in Opt.

Example

// Wait for the window "Untitled" to exist
Run("notepad");
WinWait("Untitled");
 
// Wait a maximum of 5 seconds for "Untitled" to exist
WinWait("Untitled", "", 5);
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox