Is there a function that gets the resolution of the screen? :D
Printable View
Is there a function that gets the resolution of the screen? :D
Or
More info at...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;
}
//EDIT:
This function parameter isn't a flag, therefore you can't combine them (although you wrote twice SM_CXSCREEN).Quote:
Originally Posted by Codeplug
Should beCode:int height = GetSystemMetrics(SM_CYSCREEN);
int width =GetSystemMetrics(SM_CXSCREEN);