c++windowswinapiwidescreen

How to detect whether a monitor is widescreen in Windows


I need a way to programatically detect whether the monitor is wide or not, in Windows.

GetSystemMetrics returns the size of the desktop, which sort of works, but if an user has a widescreen monitor at, say, 1024x768, I'll incorrectly classify it as non-wide.

GetDeviceCaps has similar problems with HORZRES and VERTRES, and even HORZSIZE AND VERTSIZE give incorrect results when a non-wide resolution is used in a wide monitor.

Is there any way to detect this reliably?


Solution

  • You might be able to get the actual physical size through EDID. See here: How to obtain the correct physical size of the monitor?