Obtaining System Metrics for Multiple Screens (Windows Embedded CE 6.0)
1/6/2010
You can use the GetSystemMetrics function to obtain system configuration settings on both single screen and multiple screen systems. GetSystemMetrics returns values specific to the primary screen for all metrics that were supported in versions earlier than Windows CE .NET 4.0.
The following metrics are the same for all device drivers:
- SM_CXCURSOR
- SM_CYCURSOR
- SM_CXICON
- SM_CYICON
The following display capabilities are the same for all screens:
- LOGPIXELSX
- LOGPIXELSY
- DESTOPHORZRES
- DESKTOPVERTRES
GetSystemMetrics also uses constants that refer only to a multiple screen system. The following table describes these constants.
Constant | Description |
---|---|
SM_XVIRTUALSCREEN, SM_YVIRTUALSCREEN |
Indicates the coordinates of upper-left corner of the virtual screen. |
SM_CXVIRTUALSCREEN, SM_CYVIRTUALSCREEN |
Indicates the width and height of the virtual screen. |
SM_CMONITORS |
Indicates the number of screens attached to the device. |
SM_SAMEDISPLAYFORMAT |
Indicates whether all the screens have the same color format. |
To get information about a single screen or all of the screens in the virtual screen, use the EnumDisplayMonitors function.
To change the work area of a screen, call the SystemParametersInfo function with the uiAction parameter set to SPI_SETWORKAREA and the pvParam parameter pointing to a RECT structure that is located on the desired screen. If pvParam is NULL, SystemParametersInfo modifies the work area of the primary screen. Calling SystemParametersInfo with uiAction set to SPI_GETWORKAREA always retrieves the work area of the primary screen. To get the work area of a screen other than the primary screen, call the GetMonitorInfo function.