Programmer Guide/Macro Library/GETDESKTOP: Difference between revisions

From STX Wiki
Jump to navigationJump to search
No edit summary
mNo edit summary
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{DISPLAYTITLE:{{SUBPAGENAME}}}}__NOTOC__
{{DISPLAYTITLE:{{SUBPAGENAME}}}}__NOTOC__
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.
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.
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 [[Programmer_Guide/Command_Reference/MESSAGE#MESSAGE_DESKTOP|MESSAGE DESKTOP]] command to retrieve the width of all monitors (i.e. the desktop width) and the number of monitors on the system.
 
You can use the <code>MESSAGE DESKTOP</code> command to retrieve the width of all monitors (i.e. the desktop width) and the number of monitors on the system.


==== <code>GETDESKTOP [ <var>monitor</var> ] ; [ <var>left</var> <var>top</var> <var>right</var> <var>bottom</var> ]</code> ====
==== <code>GETDESKTOP [ <var>monitor</var> ] ; [ <var>left</var> <var>top</var> <var>right</var> <var>bottom</var> ]</code> ====

Latest revision as of 10:17, 4 June 2014

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