Window Operations

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Window Operations >

Window Operations

GRW. - Get Related Window

Previous Top Next


MiniRobotLanguage (MRL)

 

GRW. Command

Get Related Window

 

 

Intention

 

The GRW. Command can be used to return the handle of windows, that are in a specified relation to the given input window. That is for example, a parent, an owner or a child-windows.

 

The handle is returned and the window is been immediately located.

 

If the handle can not be returned, for whatever reason, the command returns a zero.

 

Usage is as simple as:

 

' Locate the taskbar window above to the Start Button (XP only)

GSW.sb|$$RET

GRW.pr|$$RET|$$REA

DBP.$$REA

 

 

What is the "Z-Order"?

The z-order of a window indicates the window's position in a stack of overlapping windows. This window stack is oriented along an imaginary axis, the z-axis, extending outward from the screen. The window at the top of the z-order overlaps all other windows. The window at the bottom of the z-order is overlapped by all other windows.

The system maintains the z-order in a single list. It adds windows to the z-order based on whether they are topmost windows, top-level windows, or child windows. A topmost window overlaps all other non-topmost windows, regardless of whether it is the active or foreground window. A topmost window has the TOPMOST style. All topmost windows appear in the z-order before any non-topmost windows. A child window is grouped with its parent in z-order.

 

For more Infos see: MSDN Windows

 

 

 

 

Syntax

 

 

GRW.[P1][|P2][|P3]

 

 

Parameter Explanation

 

P1 - (optional) specifies the window that shall be returned,

     out of the following:

 

"parent","pr"

 Retrieves a handle to the specified window's parent or owner. To retrieve a handle to

 a specified ancestor, use the Ancestor commands ("pa","ra","oa").

 

"child","ch"

The retrieved handle identifies the child window at the top of the Z order, if the specified window is a parent window; otherwise, the command returns zero. The function examines only child windows of the specified Input-window. It does not examine descendant windows.

 

 

"first","gf"

The retrieved handle identifies a window of the same type that is highest in the Z order.

If the specified window is a topmost window, the handle identifies a topmost window. If the specified window is a top-level window, the handle identifies a top-level window. If the specified window is a child window, the handle identifies a sibling window.

 

 

"last","gl"

The retrieved handle identifies a window of the same type that is lowest in the Z order.

If the specified window is a topmost window, the handle identifies a topmost window. If the specified window is a top-level window, the handle identifies a top-level window. If the specified window is a child window, the handle identifies a sibling window.

 

 

"next","gn"

The retrieved handle identifies a window below the specified window in the Z order.

If the specified window is a topmost window, the handle identifies a topmost window. If the specified window is a top-level window, the handle identifies a top-level window. If the specified window is a child window, the handle identifies a sibling window.

 

 

"previouse","gp"

The retrieved handle identifies a window above the specified window in the Z order.

If the specified window is a topmost window, the handle identifies a topmost window. If the specified window is a top-level window, the handle identifies a top-level window. If the specified window is a child window, the handle identifies a sibling window.

 

 

"owner","ow"

The retrieved handle identifies the specified window's owner window, if any.

 

 

"parent ancestor","pa"

Retrieves the parent window. This does not include the owner-window.

 

 

"root ancestor","ra"

Retrieves the root window by walking the chain of parent windows.

 

 

"owner ancestor","oa"

Retrieves the owned root window by walking the chain of parent and owner windows returned, using "parent" command above.

 

 

"popup","po"

May retrieve the handle of an owned PopUp-Window to that window, if any.

 

 

"toplevel","tl"

Retrieves the window's top-level parent or owner window.

 

 

"topparent","tp"

Retrieves the window's top-level parent window.

 

 

"formhandle","fh"

 Finds the handle of the top-level window or MDI child window that is the ancestor of the

 specified window handle. The reference handle is the handle of any control on the form.

 

 

"childtop","ct"

Examines the Z order of the child windows associated with the specified parent window

 and retrieves a handle to the child window at the top of the Z order.

 

 

 

 

P2 - (optional) P2 can be the window handle of the input window.

    If its omitted, the actual window is used.

    If there is no actual window, the function will return zero.

 

P3 - (optional) Variable P3 is been loaded with the Handle of the

    Window if it is found. If the window is not found a zero is

    returned. If P2 is omitted, the result is been placed on TOS.

 

If the window is found, it is localized.

 

 

 

Example

 

' Click the volume icon in the System-Notification Area.

GSW.sb|$$RET

AGR.43|Volume

MLC.

 

 

 

 

Remarks

 

-

 

 

 

Limitations:

 

-

 

 

 

See also:

 

    ! SCW - Search-Child-Window

    !. STW. - Description

    GSW. - Get Special Window

    GCT. - Get-Childs-TopWindows