27
7
How can i force an application to be high-dpi scaled?
Pretend there is an application, who's developers manifested it as high-dpi aware, when it really isn't. How can i force dpi-scaling?
Pretend there is an applicaiton that Microsoft has applied the "
HighDpiAware
" compatiblity shim, when the application really isn't. How can i force dpi-scaling?
How can i force Windows to apply dpi-scaling to an application?
Edit: What is high-dpi scaling?
Not all users run Windows at 96dpi. Not every button is supposed to be 75x23 pixels, not every toolbar is 25pixels high, and not every treeview glyph is 16x16. If the user has chosen a different dpi setting for Windows, you need to scale everything appropriately.
Problem is that almost no developers do their job by handling high-dpi settings nicely. At best everything will stay "the same size", which means that every appears teeny tiny. At worst forms are incorrectly laid out, with text being clipped, and controls not visible.
Starting with Windows Vista, and leveraging the power of Desktop Composition, Microsoft gave up on developers doing their job, and now lie to application. They tell apps that the user is running at 96dpi. Windows then uses the video card, and Desktop Composition, to scale up the forms.
Pro: the form's content will be a nice readable size.
Con: everything will be slightly fuzzy.
This "high-dpi scaling" feature only works at the user's discretion, and requires:
- Windows Vista or newer
- Desktop Composition to be enabled
- the user to turn off "Use Windows XP style scaling"
- the user to not disable scaling for your application
As a developer, you can opt out of the high-dpi scaling; if you took the effort to write your application properly, and you know that you'll handle high-dpi properly. You opt out of this scaling by adding a manifest entry to your executable, declaring that you are "high-dpi aware".
The topic of how to make your application respect the user's preferences (including font face, font size, and dpi setting) is a question for stack overflow
. As is the syntax for the manifest entry declaring your "high-dpi awareness".
This question, on super-user, is how to ignore a developer who went ahead and added a high-dpi aware manifest entry, when in fact the application isn't high-dpi aware. They told Windows to disable scaling, but they didn't actually test the application. There is software out there with a "high-dpi aware" manifest entry, and now the application is unusable under "large fonts" (e.g. 120dpi).
I'm interested in this as well. We have a critical application that is not dpi-aware and was originally designed for an 800x600 screen. Windows does not scale it by default, and it doesn't make a difference whether we're using XP, Vista, or 7. Since our staff spend most of their time in this 800x600 app, they insist on using their 20" LCD monitors at 800x600 resolution! This is a huge waste, and the self-inflicted lack of pixels gets in their way when they need to use MS Office, IE8, etc. – Miles Erickson – 2010-04-09T19:56:47.057
1It wasn't until Windows Vista that Microsoft began leveraging Desktop Composition (what some mistakenly call Aero) to use the graphics card to scale applications that don't specifically opt-out of the scaling. There was no scaling in XP, and you don't want scaling in Vista 7. You want your application to be properly written. Walk over to a developer's machine, and change their resolution back to 1050, and set the dpi to 168. Everything will be the same huge zoomed in tard-mode, except the app won't behave properly. Tell them they're not getting any food or water until it's fixed. – Ian Boyd – 2010-04-23T00:53:38.680
We don't always have access to the developers that create the apps we use. If only we did... – Cylindric – 2010-05-19T08:57:20.123
Forms = shapes? – jiggunjer – 2017-08-18T09:08:48.553