精通
英语
和
开源
,
擅长
开发
与
培训
,
胸怀四海
第一信赖
服务方向
联系方式
If you change the DPI of your machine from 100% to any other higher value, your desktop applications may appear somewhat blurry when you compare them with other applications on the screen. Alternately, display problems may exist such as truncated text. 如果将计算机的DPI从100%更改为其他更高的值,则将桌面应用程序与屏幕上的其他应用程序进行比较时,桌面应用程序可能会显得有些模糊。或者,可能存在显示问题,例如文本被截断。
In order to fix this issue, you would need to disable DPI virtualization for the application. To do this, right-click the application’s shortcut and then click Properties. On the Compatibility tab, select Disable Display Scaling on High DPI Settings, and then click OK. 为了解决此问题,您需要为应用程序禁用DPI虚拟化。为此,请右键单击应用程序的快捷方式,然后单击。在选项卡上,选择,然后单击确定。
Alternatively, you may also disable this setting using the below Registry keys. 或者,您也可以使用以下注册表项禁用此设置。
Registry key: 注册表项: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
String: “Path to your application exe” 字符串:“应用程序exe的路径”
Value: 值: ~ HIGHDPIAWARE
Please note there is a space between ‘tilde’ and ‘HIGHDPIAWARE’. 请注意,“波浪号”和“ HIGHDPIAWARE”之间存在一个空格。
There are number of ways to set a value in the registry. The below steps will show the process to set this value in registry using Inno setup: 有多种方法可以在注册表中设置值。以下步骤将显示使用Inno设置在注册表中设置此值的过程:
var str_MyAppFullExePath: String; str_MyAppFullExePath := ExpandConstant('{app}') ; RegWriteStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers', str_MyAppFullExePath + '\' + '{#MyAppExeName}' , '~ HIGHDPIAWARE');
If your application is 32 bit, then the above command will set the value at: 如果您的应用程序是32位,则上述命令会将值设置为:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node \Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
instead of: 代替:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
This will not set the “Disable Display Scaling on High DPI Settings” property. This can be fixed by using the below command: 这不会设置“在高DPI设置上禁用显示缩放”属性。可以使用以下命令解决此问题:
if IsWin64 then begin RegWriteStringValue(HKLM64, 'SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers', str_MyAppFullExePath + '\' + '{#MyAppExeName}' , '~ HIGHDPIAWARE'); end else begin RegWriteStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers', str_MyAppFullExePath + '\' + '{#MyAppExeName}' , '~ HIGHDPIAWARE'); end ;
It will force the setup to store value in 64 bit registry. 它将强制安装程序将值存储在64位注册表中。