Get screen resolution
Hi
I'm looking for a method to find out the users screen resolution when starting the program.
Anyone have any ideas about how to find this out?
Thanks
// Lasse
[196 byte] By [
Lazze] at [2007-11-20 11:43:22]

# 1 Re: Get screen resolution
You can call GetDeviceCaps(), but the figures are not always reliable on some systems. So, I prefer to use the two lines below, that give you the size of the screen in pixels.
RECT rc;
GetWindowRect(GetDesktopWindow(), &rc);
# 3 Re: Get screen resolution
const long nScreenWidth = ::GetSystemMetrics(SM_CXSCREEN);
const long nScreenHeight = ::GetSystemMetrics(SM_CYSCREEN);