I need to be able to set the dpiAware property in the manifest of my application to "per monitor". The available choices in the properties are just to enable or disable DPI awareness. Neither of these settings works for me. I can get the behavior I want for my application if I don't embed the manifest in the exe, then edit the manifest manually. I want to automatically generate and embed the manifest. Is there something I am missing? (I am using Visual Studio 2013.)
9,077 1 1 gold badge 29 29 silver badges 33 33 bronze badges asked May 8, 2014 at 19:43 341 1 1 gold badge 3 3 silver badges 7 7 bronze badgesNew in Windows 10 is dpiAwareness as well as dpiAware, so we need to update this example a bit. Now, it is fine because if dpiAwareness does not exist, then the settings will be inherited from dpiAware.
To enable DPI awareness in full, with the latest Win10 support (see Ref URL for other possible options), which includes 'permonitor' and 'permonitorv2', which I will use instead of 'system' because your question asks it.
true/pm permonitorv2,permonitor
To disable, you'd do the opposite (no need for dpiAwareness since we don't support it):
unaware
Then there is even 'gdiScaling' if you happen to use GDI objects to paint some of your own stuff.
true
Reference: Microsoft on DPI Awareness as of latest Windows 10 build (also has tutorials on how to make your code DPI aware, even if it is a little tedious for larger projects)
4,792 5 5 gold badges 45 45 silver badges 57 57 bronze badges answered May 16, 2017 at 19:15 2,141 17 17 silver badges 24 24 bronze badgesThanks for your edit IInspectable, I had whipped this up from some bad manifest I had laying around, apparently. One word of caution to any user: If you get the manifest wrong, you will literally make your app un-runnable with a 'side-by-side config error'.
Commented Jun 9, 2017 at 15:26This manifest works, and
True/PM
50.5k 9 9 gold badges 98 98 silver badges 192 192 bronze badges
answered Nov 10, 2014 at 22:22
68.3k 40 40 gold badges 189 189 silver badges 320 320 bronze badges
With VS 2013,you don't need the UAC elements as those are automatically added, as is the dpiAware elements. You only need the compatibility GUIDs. Note this example only lists the Windows 8.1 GUID. See this blog post
Commented Jul 8, 2017 at 0:49Missing the xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings" attribute inside the
In Windows 10 1607 a new property named dpiAwareness was introduced. It allows choosing a fallback DPI scaling options and overrides dpiAware property, if present. For the best compatibility one should specify both of these and make sure your application works with all DPI-awareness levels.
The following manifest enables per-monitor DPI-awareness version 2 on Windows 10 1607+ and system DPI-awareness on Windows 7+:
true/pm PerMonitorV2 true
To disable DPI-awareness, you can either simply leave DPI-awareness unspecified (the default is unaware), or specify dpiAware as false .
Also note the gdiScaling property, which was added in Windows 10 1607. It enables automatic GDI scaling if set to true . It's very useful if your application uses GDI for drawing things.