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.)
相关问题
- Custom controls disabled. There was an internal is
- How to create PNG images with more than 72dpi usin
- How can I set the row height in Tkinter TreeView?
- Websphere MQ C++ client crashes in VS2013- library
- Export test results from Test Explorer visual stud
相关文章
- Web Test recorder does not allow me to record a te
- The program '[4432] iisexpress.exe' has ex
- How to disable CodeLens' references display in
- Breakpoint in ASP.NET MVC Razor view will not be h
- Default arguments in JAR-manifest
- Why doesn't my .tfignore file ignore my packag
- Cannot add a Data Source in web project using the
- Javascript Errors when Debugging in Visual Studio
This manifest works, and
<dpiAware>True/PM</dpiAware>
is the most important part:New 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.
To disable, you'd do the opposite (no need for
dpiAwareness
since we don't support it):Then there is even 'gdiScaling' if you happen to use GDI objects to paint some of your own stuff.
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)
In Windows 10 1607 a new property named
dpiAwareness
was introduced. It allows choosing a fallback DPI scaling options and overridesdpiAware
property, if one is 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+, per-monitor DPI-awareness on Windows 8.1+ and system DPI-awareness on Windows 7:
To disable DPI-awareness, you can either simply leave DPI-awareness unspecified (the default is unaware), or specify
dpiAware
asfalse
.Also note the
gdiScaling
property, which was added in Windows 10 1607. It enables automatic GDI scaling if set totrue
. It's very useful if your application uses GDI for drawing things.References:
High-DPI scaling since Windows 10 1607
Writing DPI-aware applications
Application manifests