GetSystemMetrics (user32)
Last changed: -24.226.54.84

.
Summary
The GetSystemMetrics function retrieves various system metrics (widths and heights of display elements) and system configuration settings. All dimensions retrieved by GetSystemMetrics are in pixels.

C# Signature:[DllImport("user32.dll")]

    static extern int GetSystemMetrics(SystemMetric smIndex);

User-Defined Types:

http://pinvoke.net/default.aspx/Enums.SystemMetric

Parameters:

smIndex

in System metric or configuration setting to retrieve. This parameter can be one of the following values. Note that all SM_CX* values are widths and all SM_CY* values are heights. Also note that all settings designed to return Boolean data represent TRUE as any nonzero value, and FALSE as a zero value.

Notes:

System metrics may vary from display to display.

GetSystemMetrics(SM_CMONITORS) counts only display monitors. This is different from EnumDisplayMonitors, which enumerates display monitors and also non-display pseudo-monitors.

The SM_ARRANGE setting specifies how the system arranges minimized windows, and consists of a starting position and a direction. The starting position can be one of the following values.

Value Meaning

ARW_BOTTOMLEFT Start at the lower-left corner of the screen (default position).

ARW_BOTTOMRIGHT Start at the lower-right corner of the screen. Equivalent to ARW_STARTRIGHT.

ARW_HIDE Hide minimized windows by moving them off the visible area of the screen.

ARW_TOPLEFT Start at the upper-left corner of the screen. Equivalent to ARV_STARTTOP.

ARW_TOPRIGHT Start at the upper-right corner of the screen. Equivalent to ARW_STARTTOP | SRW_STARTRIGHT.

The direction in which to arrange can be one of the following values.

Value Meaning

ARW_DOWN Arrange vertically, top to bottom.

ARW_LEFT Arrange horizontally, left to right.

ARW_RIGHT Arrange horizontally, right to left.

ARW_UP Arrange vertically, bottom to top.

Tips & Tricks:

Please add some!

Sample Code:

Please add some!

Alternative Managed API:

Do you know one? Please contribute it!

Information Supplied or Quoted from Microsoft Developer News (MSDN) 2006 Feb.

Documentation