2

I want to change the compatibility settings of certain programs manually using the registry in Windows. (For some programs like Microsoft Office the "Compatibility" tab does not exist in the properties window of the executable file.)

Compatibility settings are stored in registry keys of type REG_SZ with the path of the executable file as the name of the key under Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers and Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers.

However, in some cases it turns out that the value of the string is slightly different although it handles the same compatibility setting:

Example 1: screenshot

Key = C:\Program Files\7-Zip\7zFM.exe
Value = ^ HIGHDPIAWARE

This is the resulting string when you go through Troubleshoot compatibility > The program opens but doesn't display correctly > Program does not display properly when large scale font settings are selected.

Example 2: screenshot

Key = C:\Program Files\7-Zip\7zFM.exe
Value = ~^ HIGHDPIAWARE

This is the result when you go through example one and afterwards open the file properties > Compatibility > Change high DPI settings. Override high DPI scaling behavior. Scaling performed by: is already selected and set to Application. Press OK and Apply.

Example 3: screenshot

Key = C:\Program Files\7-Zip\7zFM.exe
Value = ~ HIGHDPIAWARE

This is the result when you open the file properties > Compatibility > Change high DPI settings and Override high DPI scaling behavior. Scaling performed by: is not yet selected. Tick the box and select Application, press OK and Apply.

All three versions seem to work and have the same effect. Also I can simply omit the special character at the beginning and it still looks like the setting is working.

I want to understand why the values of the registry keys are different while they seem to have the same effect? What is the purpose or meaning of the tilde sign or the circumflex sign at the beginning of the string? Does it have any hidden effect, that is not obvious at first glance?

-2

All these options have the same effect, just create slightly different values in the registry. The difference is only cosmetic in nature and has no effect. It's probably just the way that each of the programmers that created the three program-parts was thinking about the registry updates.

All three methods added HIGHDPIAWARE to the same registry key. The difference is in the additions of the ~ and ^ characters.

From Microsoft's Registry Table:

If the value contains the sequence tilde [~], then the value is interpreted as a Null-delimited list of strings (REG_MULTI_SZ).

Since this value is always interpreted as a null-delimited list of strings, the tilde character is a bit superfluous.

The caret character is a bit harder to understand, since it's totally undocumented. In general it's used in Windows as a universal escape character, but in this case it might be an undocumented alternative to the tilde, or perhaps it's just ignored by the software that handles the AppCompatFlags entry.

7
  • The reference you found is about Windows Installer packages. It is not applicable here. – Daniel B Mar 29 at 12:05
  • @DanielB: Installers may also set application compatibility. The tilde seems to be a general feature, at least for the software that processes this registry key. – harrymc Mar 29 at 12:57
  • Sorry but no. This is a totally different context. OP is looking at values in the registry. Not in some installer database that cannot natively store a REG_MULTI_SZ. – Daniel B Mar 29 at 13:26
  • @DanielB: I don't intend to argue too long, but the article does say: "The Registry table holds the registry information that the application needs to set in the system registry". – harrymc Mar 29 at 13:29
  • Thanks for your input. I can't judge if the answer is right or wrong, but at least its some kind of explanation. On a similar question about the tilde only superuser.com/questions/1095300/…, somebody referenced the same article from Microsoft. However, somebody else also said it doesn't apply to that case. – randomStack847 Mar 29 at 14:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.