IsProcessDPIAware()始终返回true。无法关闭DPI意识 [英] IsProcessDPIAware() always returns true. Can't turn off DPI awareness

查看:504
本文介绍了IsProcessDPIAware()始终返回true。无法关闭DPI意识的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Win7上的Visual Studio 2010中创建的每个Win32项目对于IsProcessDPIAware()都返回TRUE,即使默认情况下它应该根据WinAPI文档关闭。



我已经检查了以下内容:

1)我没有在我的程序中的任何地方调用过SetProcessDPIAware()。

2)Manifest Tool - >输入和输出 - >在Visual Studio中启用DPI Awareness设置为No。

3)我的清单文件中没有任何与DPI意识有关的内容

4)''在高DPI上禁用显示缩放设置''未在可执行文件的Compatiblity属性中勾选。



所以我不知道它在哪里或如何启用。



我''想要禁用它,只需使用DPI缩放。有谁知道为什么或如何启用DPI意识?

解决方案

最有可能的是,你已经熟悉这些东西,但以防万一:http://msdn.microsoft.com/en-us/library/dd464660.aspx#blurred_ui_elements [ ^ ]。



也许有人想纠正我,但我个人认为所有这些DPI意识的东西(我不是说能够像一样阅读DPI GetDeviceCaps )和DPI虚拟化是极端的跛脚。我建议尽可能远离这一切。



-SA


哎呦。好的,事实证明在Windows DPI设置中启用了使用XP Style DPI Scaling,这导致所有程序中的DPI Aware自动启用。



另外由于一些奇怪的原因,使用XP风格DPI缩放选项在对话框中显示为灰色(并勾选),但是一旦我设置了一个自定义DPI。所以这非常令人困惑。



我也不太明白有3种不同的设置组合:

1)启用XP风格缩放导致LOGPIXELSY根据DPI设置返回不同的值并强制启用DPI感知。

3)禁用XP扩展+ DPI虚拟化+ DPI识别禁用导致LOGPIXELSY返回96

4)XP缩放禁用+ DPI虚拟化+启用DPI感知,导致LOGPIXELSY返回DPI设置上的baded值



现在我明白整个系统是多么混乱!

Every Win32 project I create in Visual Studio 2010 on Win7 is returning TRUE for IsProcessDPIAware(), even though it should be off by default according to the WinAPI documentatoin.

I have already checked the following:
1) I have not called SetProcessDPIAware() anywhere in my programs.
2) Manifest Tool -> Input and Output -> Enable DPI Awareness is set to No in Visual Studio.
3) There is nothing in my Manifest file relating to DPI Awareness
4) ''Disable Display Scaling on High DPI Settings'' is not ticked in the Compatiblity properties of the executable.

So I have no idea where or how it''s getting enabled.

I''d like to disable this, and just use DPI scaling. Does anyone know why or how DPI awareness is getting enabled?

解决方案

Most likely, you are already well familiar with that stuff, but just in case: http://msdn.microsoft.com/en-us/library/dd464660.aspx#blurred_ui_elements[^].

Maybe someone would like to correct me, but I personally think all this DPI-aware stuff (I don''t mean the ability to read DPI like with GetDeviceCaps) and DPI Virtualization is the extreme lame. I would advise to keep yourself as far from all this as possible.

—SA


Whoops. Ok, it turned out that ''Use XP Style DPI Scaling'' was enabled in the Windows DPI settings, which was causing DPI Aware to be automatically enabled in all programs.

Also for some weird reason the ''Use XP Style DPI Scaling'' option was greyed out (and ticked) in the dialog, but ungreyed itself once I set a custom DPI. So that was very confusing.

I also didn''t quite understand that there were 3 different combinations of settings:
1) XP style scaling enabled which causes LOGPIXELSY to return different values based on DPI setting and forces DPI-aware to be on.
3) XP scaling disabled + DPI virtualization + DPI-aware disabled which causes LOGPIXELSY to return 96
4) XP scaling disabled + DPI Virtualization + DPI-aware enabled which causes LOGPIXELSY to return values baded on DPI setting

Now I understand how messy this whole system is !


这篇关于IsProcessDPIAware()始终返回true。无法关闭DPI意识的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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