GETDESKTOP

From STX Wiki
Jump to navigationJump to search

Use this function to return the coordinates and size of a particular monitor relative to the whole desktop. The desktop is the area of all attached monitors.

The primary monitor is a Windows concept. This is the monitor on which dialogs are centred by default and the application task bar appears. The Windows API (Application Programming Interface) returns the origin coordinates 0,0 for the upper left hand corner of the primary monitor. This means that monitors left of the primary monitor have negative coordinates. You can use the MESSAGE DESKTOP command to retrieve the width of all monitors (i.e. the desktop width) and the number of monitors on the system.

GETDESKTOP [ monitor ] ; [ left top right bottom ]

monitor
The monitor to get the desktop coordinates for.
Default: the primary monitor.
left, top, right, bottom
The percentage of the screen by which to shrink the left, right, top and bottom coordinates. These values must be 0 <= margin <= 40. If an invalid value is passed, it is set to zero.
Default: all 0
Result
The window coordinates 'xOrigin yOrigin width height'
see also
GETMONITOR, GETWINDOWPOS, SETWINDOWPOS

Examples

#result := GETDESKTOP

For a system with a primary monitor with a resolution of 1024x768, #result will contain the values 0 0 1024 768

If you have a 3 monitor system, where the middle monitor is the Primary monitor and the resolution is as above, the following command will return the values -1024 0 1024 768

#result := GETDESKTOP 1

Navigation menu

Personal tools