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.
int GetSystemMetrics( int nIndex )
If the function succeeds, the return value is the requested system metric or configuration setting. If the function fails, the return value is zero.
int cx = GetSystemMetrics(SM_CXSCREEN);
int cy = GetSystemMetrics(SM_CYSCREEN);
printf("The screen resolution is %d x %d\n", cx, cy);