Programmer Guide/Macro Library/GETDESKTOP: Difference between revisions

From STX Wiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 11: Line 11:
:;<var>monitor</var> :The monitor to get the desktop coordinates for.  
:;<var>monitor</var> :The monitor to get the desktop coordinates for.  
::Default: the primary monitor.
::Default: the primary monitor.
:;<var>left, top, right, bottom</var> :The percentage of the screen by which to shrink the left, right, top and bottom coordinates. These values must be 0 <= margin <= 40.  
:;<var>left, top, right, bottom</var> :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
::Default: all 0


=====Result:=====
====Result:====
:The window coordinates '<code>xOrigin yOrigin width height</code>'


The window coordinates "<code>xOrigin yOrigin width height</code>".
====Examples====
 
=====Examples:=====


<pre>
<pre>
#result := $(GETDESKTOP)
#result := GETDESKTOP
</pre>
</pre>
For a system with a primary monitor with a resolution of 1024x768, #result will contain the values <code>0 0 1024 768</code>
For a system with a primary monitor with a resolution of 1024x768, #result will contain the values <code>0 0 1024 768</code>
Line 28: Line 27:


<pre>
<pre>
#result := $(GETDESKTOP 1)
#result := GETDESKTOP 1
</pre>
</pre>
=====see also:=====
=====see also:=====


[[Programmer Guide/Macro Library/GETMONITOR|GETMONITOR]], GETWINDOWPOS, [[Programmer Guide/Macro Library/SETWINDOWPOS|SETWINDOWPOS]]
[[Programmer Guide/Macro Library/GETMONITOR|GETMONITOR]], GETWINDOWPOS, [[Programmer Guide/Macro Library/SETWINDOWPOS|SETWINDOWPOS]]

Revision as of 15:57, 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 ]

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'

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