For enabling DPI awareness, the GRIP game wrongly uses a registry-based workaround instead of proper manifest declaration.
Such workaround is solely intended for OLD applications and should NOT be used for new applications written by developers aware of DPI awareness.
Any workaround may eventually stop to work, while the proper solution will work as expected. Moreover, adding manifest declaration is simpler than adding the workaround.
Wrong approach — workaround
The workaround is intended for old applications which authors were not aware of DPI awareness itself. The workaround works by overriding application’s DPI awareness by adding a Windows-registry parameter which name is the path to executable and the value is `HIGHDPIAWARE`:
Code: Select all
But when writing new applications which developers are aware of DPI awareness, using the workaround does not make sense. Just declare DPI awareness instead of overriding it. Needless to say, declaring DPI awareness is much simpler than dealing with Windows registry.
Proper solution — manifest declaration
The proper approach is to put a simple DPI-awareness declaration into the application’s manifest. This can be enabled in Visual Studio 2017 project settings:
Configuration Properties → Manifest Tool → Input and Output → DPI Awareness → High DPI Aware.
Or the manifest should be edited manually:
1. The `assembly` element of the manifest must have the ` xmlns:asmv3="urn:schemas-microsoft-com:asm.v3"` attribute.
2. The `assembly` element must contain the following `asmv3:application` element (besides other needed elements, not instead):
Code: Select all
That’s all. Thanks.