如何为所有显示器检测"一个缩放级别"?

时间:2015-04-06 20:24:09

标签: winapi windows-8 windows-8.1

Windows 8.1引入了这个荒谬的 bug 功能,它可以在每个屏幕的基础上自动决定用户的DPI缩放。我指示用户关闭此功能,方法是单击控制面板中的复选框,然后选择#34;让我为所有显示器选择一个缩放级别"。这段1:22分钟的视频显示了设置的位置: https://www.youtube.com/watch?v=sE3IUTPy1WA

无论如何,我的问题是,如何以编程方式确定此设置是打开还是关闭?是否可以进行Win API调用,或者我可以查询的注册表设置?如果关闭此设置,我希望能够在我的应用程序中检测到它。

1 个答案:

答案 0 :(得分:1)

您可以查询HKCU\Control Panel\Desktop\Win8DpiScaling

此密钥和其他相关密钥记录在DPI-related APIs and registry settings,但相关文本如下:

  

控制面板\外观和个性化\显示用户   界面(UI)包括一个复选框:让我选择一个缩放级别   用于控制系统是否应用的所有显示器   所有显示器的单一比例因子(如Windows®8及更早版本)   版本的Windows),或不同的比例因素   考虑每个显示器的像素密度(Windows 8.1默认值)。

     

此复选框配置HKCU \ Control Panel \ Desktop \ Win8DpiScaling   Windows 8.1中的注册表项。

Key value : 0   Meaning : Different scale factors for each display: Windows 8.1 default.Content that is moved from one display to another will be the right size, but can be bitmap-scaled.
Key value : 1   Meaning : Same scale factor is applied to all displays: Windows 8 and earlier Windows versions behavior.Content that is moved from one display to another might be the wrong size