Or
Code:
#include <stdio.h>
#include <windows.h>
int main(int argc, char *argv[]){
DEVMODE res;
EnumDisplaySettings(NULL,ENUM_CURRENT_SETTINGS,&res);
printf("The screen resolution is %dx%d and %d bit per pixel\n",res.dmPelsWidth,res.dmPelsHeight,res.dmBitsPerPel);
return 0;
}
More info at...
//EDIT:
Originally Posted by
Codeplug
GetSystemMetrics(SM_CXSCREEN | SM_CXSCREEN);
This function parameter isn't a flag, therefore you can't combine them (although you wrote twice SM_CXSCREEN).
Should be
Code:
int height = GetSystemMetrics(SM_CYSCREEN);
int width =GetSystemMetrics(SM_CXSCREEN);