Core Function WinGetState

From Sputnik Wiki
Jump to: navigation, search
WinGetState ( <title>, <text> )

Contents

Description

Retrieves the state of a given window.

Parameters

Title

The title of the window.

Text

Optional; The text of the window to read.

Return Value

Success: Returns a value indicating the state of the window. Multiple values are added together so use BitAND() or use the & operator to examine the part you are interested in:

1 = Window exists 
2 = Window is visible 
4 = Windows is enabled 
8 = Window is active 
16 = Window is minimized 
32 = Windows is maximized 

Failure: Returns 0.

Remarks

None.

See "WinTitleMatchMode" in Opt

Example

// Check if a new notepad window is minimized
$state = WinGetState("Untitled", "");
 
// Is the "minimized" value set?
If ($state & 16)
{
    MsgBox("Window is minimized");
}

OR

// Check if a new notepad window is minimized
$state = WinGetState("Untitled", "");
 
// Is the "minimized" value set?
If ( BitAnd($state, 16) )
{
    MsgBox("Window is minimized");
}
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox