GetSystemMetrics() returns wrong value for SM_CXSCREEN

A program must tell the operating system that it is DPI-aware to get the true resolution when you go past 125%. That's best done with a manifest, as explained in this MSDN Library article.


To make you application aware of dpi make and manifest file and put the following text in it.

<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" >
  <asmv3:application>
    <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
      <dpiAware>true</dpiAware>
    </asmv3:windowsSettings>
  </asmv3:application>
</assembly>