locked
What is the equivalent in the manifest for the Override DPI scaling "Application" on Windows 10? RRS feed

  • Question

  • I have a multimonitor, full screen application that gets the screen resolution using

    setSize( sf::Vector2u(
        GetSystemMetrics( SM_CXVIRTUALSCREEN ),
        GetSystemMetrics( SM_CYVIRTUALSCREEN ) ) );

    The application should ignore the system DPI settings and return not scaled screens resolutions

    When I set the "Override high DPI scaling" in the file properties under Compatibility tab to "Application" the app ignores the DPI scaling of the screen and GetSystemMetrics returns the native resolution of the screen. When I set the dpiAware/dpiAwareness in the manifest the application crashes or returns wrong( scaled ) value of the native resolution of both screens. I've tried all possible combinations in the manifest, bt none seem to work.

    So the question is How can I reproduce the behaviour of "Override high DPI scaling" = "Application" in the manifest?

    This is my manifest:

    <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:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">
          <dpiAwareness>permonitorv2</dpiAwareness>
        </asmv3:windowsSettings>
    
      </asmv3:application>
    </assembly>


    Saturday, December 1, 2018 9:32 PM

All replies

  • I believe you are looking for the SetProcessDpiAwareness function.

    Tim Roberts | Driver MVP Emeritus | Providenza &amp; Boekelheide, Inc.

    Sunday, December 2, 2018 7:40 AM
  • Hello,

    Have you got any updates? If your case has been solved, please help to mark answers. If not, just feel free to contact us.

    Your understanding and cooperation will be grateful.

    Best Regards,

    Jack


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, December 18, 2018 9:51 AM