Enhanced system DPI scaling with VS2017

前端 未结 1 1558
夕颜
夕颜 2021-01-05 09:39

I have a MFC app that has default MFC DPI support: it is high DPI aware, but not per-monitor DPI aware. Windows 10 version 1703 added support for System (enhanced) DPI scali

1条回答
  •  有刺的猬
    2021-01-05 10:29

    Add the gdiScaling setting to your application's manifest to tell Windows to apply GDI scaling on all monitors.

    1. Create a new file GdiScaling.manifest in your project.
    
      
        
          true
        
      
    
    
    1. In project settings, in Manifest Tool, set Additional Manifest Files to GdiScaling.manifest. This will merge your GDI scaling settings into the rest of the generated manifest.

    When you build, you will get a warning about Microsoft not having its act together, but you already knew that. :-) The exact text of the warning is this:

    GdiScaling.manifest : manifest authoring warning 81010002: Unrecognized Element "gdiScaling" in namespace "http://schemas.microsoft.com/SMI/2017/WindowsSettings".

    Fortunately, Windows doesn't care and recognizes the setting anyway.

    0 讨论(0)
提交回复
热议问题