Hi, I'm trying to make a program that sets up the hight dpi compatibility mode programatically on Windows 10, so that I don't have to set up manually the properties of every legacy *.exe program I use, there are hundreds.

When you set up that on a local drive, Windows creates a registry entry such as:

[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers] "C:\Program Files (x86)\Iperius Backup\Iperius.exe"="~ HIGHDPIAWARE"

But if the file resides on a mounted share, the value will be something like:

SIGN.MEDIA=13E07B7 Somedir\test\test.exe

The SIGN.MEDIA is different for every directory on the same share.

Is there a C/C++ API that would allow to compute this SIGN.MEDIA value?

I found no authoritative answer but this seems to be the answer (quote and link follows.)

From the original post information they had a Hex value of 2A314 which equals decimal 172820 - which is the size of the file they list in bytes. My test file was a hex value of 1B32F48 and is 28,520,264 bytes.

From https://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/10442e93-1ae6-4bb1-8693-d476916f5292/windows-compatibility-setting-for-removable-media-questions?forum=windowscompatibility

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.