Programmer Guide/Macro Library/GETDESKTOP: Difference between revisions

From STX Wiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 1: Line 1:
{{DISPLAYTITLE:{{SUBPAGENAME}}}}__NOTOC__
{{DISPLAYTITLE:{{SUBPAGENAME}}}}__NOTOC__
==GETDESKTOP==


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.
Line 8: Line 7:
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.
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.


=====Usage:=====
==== <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>


=====Parameters:=====
=====Parameters:=====

Revision as of 15:50, 15 May 2012


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 ]

Parameters:
monitor
The monitor to get the desktop coordinates for. Default is 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.
Result:

The window coordinates "xOrigin yOrigin width height".

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)
see also:

GETMONITOR, GETWINDOWPOS, SETWINDOWPOS

Navigation menu

Personal tools