5

Per the 2 screenshots below, Adobe Acrobat DC and Internet Explorer failed to scale correctly on my second monitor because the menus are too big. Under Settings > System > Display, I cannot decrease 'the size of text, apps, and other items' because the slider is already at the extreme left. But some other programs (MS Office) does scale correctly.

Display adapters: Intex HD Graphics 530, NVIDIA GeForce GTX 960M with Driver Version 354.74
Monitor 1 (with correct scaling): Lenovo Ideapad Y700, 3840 x 2160
Monitor 2 (with imperfect scaling): Dell E153FP, 1024 x 768

enter image description here

2
  • It will likely help if you can provide details on the video card (s) in use, driver version(s) for them, the monitors makes/models and the resolutions in use.
    – Argonauts
    Jul 10, 2016 at 22:41
  • @Argonauts Done. I will add the driver version(s) tomorrow.
    – user269574
    Jul 17, 2016 at 5:34

1 Answer 1

4
+50

Why some programs misbehave on different screens but some don't

Modern Windows applications should include a manifest, which is an XML document that's usually embedded in the main EXE file. Manifests declare several important things, including whether the program will ask to be UAC-elevated and, more relevantly, the level of DPI awareness. If a program understands how to redraw itself for different dots-per-inch settings, it is DPI aware.

This Old New Thing article mentions the three levels of DPI awareness available on Windows 8.1 and up: no awareness (in which case the system will scale the program up, producing blurriness), system DPI awareness, and per-monitor DPI awareness. The difference between those last two is that per-monitor-DPI-aware programs need to redraw themselves depending on which monitor they're on, since different monitors can have different DPIs. System-DPI-aware programs scale themselves for the highest-DPI monitor, then the system scales them down as appropriate.

I inspected the manifests of the programs you mentioned by searching with a hex editor for the string <dpiAware. These are my results:

  • Internet Explorer 11: True/PM (per-monitor aware)
  • Microsoft Word 2016: True (system aware)
  • Adobe Reader XI: True/PM

Word, therefore, is partially handled by the system, which explains why it works as you expect. The other programs should handle themselves, but evidently they messed up. Per-monitor-DPI-aware programs receive information about a monitor change by the WM_DPICHANGED window message, but these apparently don't do the right thing in response to that.

Further reading: Writing DPI-Aware Desktop and Win32 Applications

How to fix it

It's possible to use the compatibility infrastructure to force blurriness (i.e. make the programs not DPI aware at all), but it seems that you want to make these programs only partially DPI-aware (i.e. use the system level). The only I way I can think of to do that is to whack the EXE with a hex editor and change the manifest. I like XVI32, no affiliation.

Run your hex editor as administrator and open the program file you want to change. Search for <dpiAware, then read a bit ahead until you find True/PM (or a different capitalization of the same). It's probably followed immediately by the </dpiAware> closing tag, so we'll write over it like so:

Old: True/PM</dpiAware>
New: True</dpiAware>   

Make sure to overwrite the extra space (re>) with spaces. You might have to fiddle the file permissions before you save. Once the file is changed, it will be only a system-DPI-aware program.

It appears that the build of Internet Explorer that comes with Windows 10 uses SetProcessDpiAwareness rather than a manifest to set the DPI awareness. Therefore, we need to get a little more serious with the hex editing. Search for windowsSettings, then move your cursor to immediately after the closing bracket of the previous application tag. Overwrite with all of this:

<windowsSettings><dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware></windowsSettings></application><compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"><application><!--

Once you're done, it should look like this (I highlighted the new part in red and placed the blue cursor at the start of the changed portion):

iexplore.exe changed

That takes advantage of the extra spaces and comments in the default manifest to insert our new setting and move the compatibility element forward a bit. When dpiAwareness is set in the manifest, the SetProcessDpiAwareness function will have no effect.

There is a chance that Windows Resource Protection will roll back the changes, so if the program is automatically reverted, you might need to set up a script to recopy the new version over it.

Caution! It's very important that you overwrite rather than insert or delete characters. Inserting or deleting will shift the rest of the executable data, breaking a lot of things. If you make a transcription error, do not press Backspace or Delete. Instead, move your cursor back and overwrite your error with the correct character(s). If you haven't used a hex editor before, you should make a back-up of the EXE file before modifying it.

5
  • Thank you deeply. Sorry to trouble you again: XVI32 is impeding me from Saving. To avoid protracting this post, I posted the problem at superuser.com/q/1100160/269574? Can you please see it?
    – user269574
    Jul 13, 2016 at 3:12
  • No problem. Sorry, but as you predicted, There is a chance that Windows Resource Protection will roll back the changes, so if the program is automatically reverted. You appear correct (as always), because IE has reverted the code and also the Permission settings (that I questioned separately). How easy is it to preclude this reversion? Maybe it is easiest if I cease using IE?
    – user269574
    Jul 14, 2016 at 5:18
  • @Timere Sadly, I don't know of a safe way to disable WRP. Do make sure that you've changed the owner of the file from TrustedInstaller to Administrators (in addition to changing the file permissions). Alternatively, switching to a different browser might be the way to go. I've deleted my obsolete comments.
    – Ben N
    Jul 17, 2016 at 2:16
  • Hi again. I forgot to ask: how did you redden the text string? I ask because I am trying to do the same for another similar problem: superuser.com/q/1127953/269574
    – user269574
    Sep 24, 2016 at 21:36
  • @Timere When a character is highlighted (with the blue box), holding Shift while pressing the arrow keys (to move) turns the traversed text red.
    – Ben N
    Sep 24, 2016 at 21:40

You must log in to answer this question.