I'm afraid I don't think it's necessarily that easy - The information available to you is only what the driver(s) provides.
I think my first step would be to try getting
HORZRES and divide by
HORZSIZE and see if that gives you a different and/or gives you a correct line width (it will give you pixels / mm. (Divide HORZSIZE, or multiply HORZRES, by 25.4 to get DPI). Also check the value that
HORZSIZE reports first to see if it matches your physical screen width.
Check that you are using the correct driver for your monitor (as that should presumably return the correct physical height and width, so that the resolution is calculated correct). However, I note there is "caveat" on the
GetDeviceCaps[
^] page that says "Unfortunately, a display driver that is implemented to the Windows Display Driver Model (WDDM) (introduced in Windows Vista) causes GDI to not get the info, so GetDeviceCaps must always calculate the info" (in other words, in this case it always assumes 96 DPI).
Otherwise, I'm afraid just to do some more research online. E.g. There are some interesting possible suggestions on this page:
http://stackoverflow.com/questions/4631292/how-detect-current-screen-resolution[
^]
As you'll see there, you may also need to do some work to deal with possible multiple monitor situations.
Regards,
Ian.