GetRect Function (AnyWin)

Class

AnyWin class.

Action

Returns the size and position of the window.

Syntax

SizeRect = window.GetRect ([bGlobal])
Variable Description
SizeRect The size and position of the window. The size is the size of the whole window, not the client area. RECT.
bGlobal Optional. TRUE to return global coordinates (relative to the entire screen), or FALSE (default) to return coordinates relative to the parent window only. BOOLEAN.

Notes

GetRect returns a record of the RECT data type, which contains the size and position of the window.

You can use GetRect to calculate coordinates for custom windows, such as icon bars. Scripts that calculate coordinates in this way will be more portable than scripts with hard-coded coordinates, because coordinates themselves are not portable.

To click on a location in a tool bar or icon bar, use coordinate syntax to specify where to click. For example, to select a tool from a pop-up tool bar with 2 columns and 12 rows, use a call like the following:
PopList.Select("(2:2,5:12)")

When used with the DesktopWin class, GetRect does not have the optional bGlobal argument. Coordinates for DesktopWin are always global.

GetRect cannot be used with a menu or menu-item.

Example

RECT WindowShape
WindowShape = Find.GetRect()