2015-04-06 90 views
1

Windows 8.1引入了这个荒谬的 错误 功能,它可以自动根据每个屏幕为用户决定DPI缩放比例。我指示用户关闭此功能,方法是单击控制面板中的“允许我为所有显示选择一个缩放级别”复选框。这1:22分钟的录像显示了设置为: https://www.youtube.com/watch?v=sE3IUTPy1WA如何检测“所有显示器的缩放级别”?

不管怎样,我的问题是,我怎么能编程方式确定此设置是否打开或关闭?是否有可以进行的Win API调用,或者我可以查询的注册表设置?如果此设置关闭,我希望能够检测到我的应用程序内。

回答

1

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

此键和其他相关的关键点在DPI-related APIs and registry settings证明,但相关的文字如下:

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

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

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 
+0

完美,谢谢。我会测试 – mikew

+0

呃,应该不是程序使用api调用而不是注册表?那是除非没有api。 –

+0

@David:据我所知,没有API返回通过GUI选择的值。虽然您可以调用[GetScaleFactorForMonitor](https://msdn.microsoft.com/en-us/library/windows/desktop/dn302060.aspx)并比较这些值,但没有API会告诉您它们是否全部相同由于这个特定的GUI设置,或者因为它们被单独设置为相同的值。 – IInspectable

相关问题