How to obtain the correct physical size of the monitor?
- by KindDragon
How can I get the size of the display in centimeters or inches?
This code does not always works correctly:
HDC hdc = CreateDC(_T("DISPLAY"),dd.DeviceName,NULL,NULL);
int width = GetDeviceCaps(hdc, HORZSIZE);
int height = GetDeviceCaps(hdc, VERTSIZE);
ReleaseDC(0, hdc)
Especially for multi-monitor configuration.
Update: I need to get the size just for ordinary monitors, which have a constant physical size.