GetWindowPosition()

Summary

Gets the position of a window.

Syntax

win_position = GetWindowPosition(string window)

Argument Contents
window String of the form "window type|window name," or "window name" if the window name is unique among the window types, or null for the current window

Returns

An array of two integers indicating the position of the upper-left hand corner of the window:

Element Type Contents
1 Integer X-coordinate of the upper-left corner
2 Integer Y-coordinate of the upper-left corner

Notes

  • For map, layout, and editor windows, the position values are expressed as percentages of the frame window. For the frame window, the position values are percentages of the Windows desktop.

  • The values returned by GetWindowPosition() are always between 0 and 100, inclusive.

  • For more information on window types, see Windows.

Example

fpos = GetWindowPosition("Frame|")
mpos = GetWindowPosition("Map|United States")

See Also

Function Summary
SetWindowPosition() Sets the position of a window
GetWindowSize() Determines the size of a window