2.1.25.31 GetSystemMetrics


Description

This function retrieves various system metrics (widths and heights of display elements) and system configuration settings. All dimensions retrieved by GetSystemMetrics are in pixels. System metrics may vary from display to display.

Syntax

int GetSystemMetrics( int nIndex )

Parameters

nIndex
[input] Specifies the system metric or configuration setting to retrieve. See all SM_* in OriginC\system\mswin.h file. All SM_CX* values are widths. All SM_CY* values are heights.

Return

If the function succeeds, the return value is the requested system metric or configuration setting. If the function fails, the return value is zero.

Examples

EX1

void GetSystemMetrics_ex1()  
{
    int cx = GetSystemMetrics(SM_CXSCREEN);
    int cy = GetSystemMetrics(SM_CYSCREEN);
    printf("The screen resolution is %d x %d\n", cx, cy); 
}

Remark

See Also

Header to Include

origin.h

Reference