IDLsysMonitorInfo::GetRectangles

The IDLsysMonitorInfo::GetRectangles function method retrieves the monitor coordinate rectangles.

Syntax

Result = Obj->[IDLsysMonitorInfo::]GetRectangles( [, /EXCLUDE_TASKBAR])

Return Value

Returns the monitors’ coordinate rectangles. A coordinate rectangle refers to a 4-element array of the form [x,y,w,h], where x and y are the origin at the upper-left corner of the rectangle and where w and h are the width and height of the rectangle.

There is one row returned in the array for each monitor, each column in the array contains a value for a component of each monitor (see Table 10-3 for the array columns).

Array Column

Content

First Column

Contains the x coordinate of the upper-left pixel of the monitor

Second Column

Contains the y coordinate of the upper-left pixel

Third Column

Contains the monitor width (w) in pixels

Fourth Column

Contains the monitor height (h) in pixels

Note: If you have multiple monitors, depending upon their arrangement, the x and y coordinates may be negative. In addition, the order of monitors within the returned array may not always match the physical arrangement of monitors.

Note: On Windows, the monitor width and height will typically include the scaling factor for your operating system, while the x and y coordinates will not include this factor. For example, if your system is set to a scaling factor of 250%, your primary monitor might show a width of 3840 pixels while your secondary monitor will have an x coordinate of 9600 pixels. If you wanted to create a graphics window on the secondary monitor, you would then use a window position greater than 9600.

Tip: You can use the IDLsysMonitorInfo::GetPrimaryMonitorIndex method to determine the row that corresponds to the primary monitor.

Note: If no monitors are available on the system, or if the DISPLAY_NAME property does not refer to a valid X server connection, IDLsysMonitorInfo::GetRectangles returns a four-element IDL long array containing zero values.

Arguments

None

Keywords

EXCLUDE_TASKBAR

Set this keyword to cause the returned monitor rectangle information to not include the region of the monitor occupied by the Windows task bar. This keyword is supported on the Windows platform only and is ignored on all other platforms.

Version History

6.3

Introduced