覆盖DPI缩放“应用程序”的清单中的等价物是什么?在Windows 10上? [英] What is the equivalent in the manifest for the Override DPI scaling "Application" on Windows 10?

查看:174
本文介绍了覆盖DPI缩放“应用程序”的清单中的等价物是什么?在Windows 10上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个多监视器,全屏应用程序,使用

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

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

应用程序应忽略系统DPI设置并返回未缩放的屏幕分辨率

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

当我设置"覆盖高DPI缩放"时在"兼容性"选项卡下的"文件属性"中,"应用程序"应用程序忽略屏幕的DPI缩放,GetSystemMetrics返回屏幕的原始分辨率。当我在清单中设置
dpiAware / dpiAwareness时,应用程序崩溃或返回两个屏幕的原始分辨率的错误(缩放)值。我已经在清单中尝试了所有可能的组合,但似乎没有工作。

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.

所以问题是如何重现 "覆盖高DPI缩放"的行为? ="应用程序"在清单?

So the question is How can I reproduce the behaviour of "Override high DPI scaling" = "Application" in the 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>




推荐答案

我相信您正在寻找SetProcessDpiAwareness函数。
I believe you are looking for the SetProcessDpiAwareness function.


这篇关于覆盖DPI缩放“应用程序”的清单中的等价物是什么?在Windows 10上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆