Export (0) Print
Expand All

GetSystemMetrics (Windows CE 5.0)

Windows CE 5.0
Send Feedback

This function retrieves the dimensions — widths and heights — of Windows display elements and system configuration settings. All dimensions retrieved by GetSystemMetrics are in pixels. The RAPI version is CeGetSystemMetrics (RAPI) for versions 2.0 and later.

int GetSystemMetrics(
  int nIndex
); 

Parameters

nIndex
Specifies the system metric or configuration setting to retrieve. All SM_CX* values are widths. All SM_CY* values are heights. The following values are defined.
ValueDescription
SM_CMONITORSNumber of display monitors on the Windows CE-based device. Supported in Windows CE .NET 4.0 and later.
SM_CXBORDER, SM_CYBORDERWidth and height, in pixels, of a window border. This is equivalent to the SM_CXEDGE value for windows with the 3-D look.
SM_CXCURSOR, SM_CYCURSORWidth and height, in pixels, of a cursor. The system cannot create cursors of other sizes.
SM_CXDLGFRAME, SM_CYDLGFRAMESame as SM_CXFIXEDFRAME and SM_CYFIXEDFRAME.
SM_CXDOUBLECLK, SM_CYDOUBLECLKWidth and height, in pixels, of the rectangle around the location of a first click in a double-click sequence. The second click must occur within this rectangle for the system to consider the two clicks a double-click. (The two clicks must also occur within a specified time.)
SM_CXEDGE, SM_CYEDGEDimensions, in pixels, of a 3-D border. These are the 3-D counterparts of SM_CXBORDER and SM_CYBORDER.
SM_CXFIXEDFRAME, SM_CYFIXEDFRAMEThickness, in pixels, of the frame around the perimeter of a window that has a caption but is not sizable. SM_CXFIXEDFRAME is the width of the horizontal border and SM_CYFIXEDFRAME is the height of the vertical border.

Same as SM_CXDLGFRAME and SM_CYDLGFRAME.

SM_CXHSCROLL, SM_CYHSCROLLWidth, in pixels, of the arrow bitmap on a horizontal scroll bar; and height, in pixels, of a horizontal scroll bar.
SM_CXICON, SM_CYICONThe default width and height, in pixels, of an icon. The LoadIcon function can load only icons of these dimensions.
SM_CXICONSPACING, SM_CYICONSPACINGDimensions, in pixels, of a grid cell for items in large icon view. Each item fits into a rectangle of this size when arranged. These values are always greater than or equal to SM_CXICON and SM_CYICON.
SM_CXMENUCHECK, SM_CYMENUCHECKDimensions, in pixels, of the default menu check-mark bitmap.
SM_CXSCREEN, SM_CYSCREENWidth and height, in pixels, of the screen of the primary display monitor. These are the same values you obtain by calling GetDeviceCaps (hdcPrimaryMonitor, HORZRES/VERTRES).
SM_CXSMICON, SM_CYSMICONRecommended dimensions, in pixels, of a small icon. Small icons typically appear in window captions and in small icon view.
SM_CXVIRTUALSCREEN, SM_CYVIRTUALSCREENWidth and height, in pixels, of the virtual screen. The virtual screen is the bounding rectangle of all display monitors. Supported in Windows CE .NET 4.0 and later.
SM_CXVSCROLL, SM_CYVSCROLLWidth, in pixels, of a vertical scroll bar; and height, in pixels, of the arrow bitmap on a vertical scroll bar.
SM_CYCAPTIONHeight, in pixels, of a normal caption area.
SM_CYMENUHeight, in pixels, of a single-line menu bar.
SM_DEBUGTRUE or nonzero if the debugging version of USER.EXE is installed; FALSE or zero otherwise.
SM_SAMEDISPLAYFORMATTRUE if all the display monitors have the same color format, FALSE otherwise. Supported in Windows CE .NET 4.0 and later.
SM_XVIRTUALSCREEN, SM_YVIRTUALSCREENCoordinates for the left side and the top of the virtual screen. The virtual screen is the bounding rectangle of all display monitors. Supported in Windows CE .NET 4.0 and later.

Return Values

The requested system metric or configuration setting indicates success. Zero indicates failure. The GetLastError function does not provide extended error information.

Remarks

Windows CE does not support the following nIndex values:

SM_ARRANGESM_CYMINIMIZED
SM_CLEANBOOTSM_CXMINSPACING
SM_CMETRICSSM_CYMINSPACING
SM_CMOUSEBUTTONSSM_CXMINTRACK
SM_CXDRAGSM_CYMINTRACK
SM_CYDRAGSM_CXSIZE
SM_CXFRAMESM_CYSIZE
SM_CYFRAMESM_CXSIZEFRAME
SM_CXFULLSCREENSM_CYSIZEFRAME
SM_CYFULLSCREENSM_CXSMSIZE
SM_CXHTHUMBSM_CYSMSIZE
SM_CYKANJIWINDOWSM_CYSMCAPTION
SM_CXMAXIMIZEDSM_CYVTHUMB
SM_CYMAXIMIZEDSM_DBCSENABLED
SM_CXMAXTRACKSM_MENUDROPALIGNMENT
SM_CYMAXTRACKSM_MIDEASTENABLED
SM_CXMENUCHECKSM_MOUSEPRESENT
SM_CYMENUCHECKSM_MOUSEWHEELPRESENT
SM_CXMENUSIZESM_NETWORK
SM_CYMENUSIZESM_PENWINDOWS
SM_CXMINSM_SECURE
SM_CYMINSM_SHOWSOUNDS
SM_CXMINIMIZEDSM_SLOWMACHINE
 SM_SWAPBUTTON

If the Windows CE–based device you are targeting supports a mouse cursor, you can use the SM_CXCURSOR or SM_CYCURSOR values in the nIndex parameter.

Windows CE versions that support mouse cursors include the Iconcurs and Mcursor components rather than the Icon and Cursor components.

When working with RAPI in Windows CE 1.0 and 1.01, use the PegGetSystemMetrics function.

System metrics may vary from display to display.

The system metrics SM_CXICON, SM_CYICON, SM_CXICONSPACING, SM_CYICONSPACING, SM_CXSMICON, SM_CYSMICON, SM_CXCURSOR, SM_CYCURSOR return values in high dpi mode in Windows CE 5.0 and later.

Requirements

OS Versions: Windows CE 1.0 and later.
Header: Winuser.h.
Link Library: Wmbase.lib.

See Also

GetDeviceCaps | LoadIcon | SystemParametersInfo | System Information Functions


Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.


Show:
© 2014 Microsoft