7

Is there a way to force an application to use DPI virtualization in Windows 8.1? I have an application that wrongly declares to be DPI aware, and displays too small on my high DPI screen (don't have the source). It would be sufficient if it was scaled up 2x by Windows.

I tried editing the .exe's manifest, and setting <dpiAware>false</dpiAware>, but it had no effect. (It might have made the few pieces of the application that used a larger (appropriate) font use a small font (in pixels), like I'd expect for DPI virtualization, I'm not entirely sure... but it certainly did not activate the DWM scaling.)

What can I do? I read that other settings in the manifest may affect DPI virtualization other than dpiAware, is this true? The app might be setting DPI awareness at runtime via API, how can I find out if this is the case?

(Posting this here and not on superuser because there is no user-facing setting for this, and I expect the answer to be something along the lines of "edit the manifest such-and-such" or "inject a DLL/attach a debugger and do this". Also the fact that I don't have the source is secondary, I also have in-house apps where I have the source and would like to fix, and I'm asking for the more general solution that would fix both cases. I hope that's OK.)

jdm
  • 9,470
  • 12
  • 58
  • 110

1 Answers1

5

I just released a DLL that hooks and redirects calls to SetProcessDPIAware. For applications that disable DPI scaling through code, this is a fast and easy fix (compared to binary patching). Just load the offending application with a tool like CFF Explorer and add this DLL to the import table. (Alternatively, it could be injected dynamically at application launch.)

Note that the current release only hooks SetProcessDPIAware and leaves SetProcessDPIAwareness untouched. If that's an issue, feel free to ping me and I'll hook both.

DPIMangler: Blog post, source code.

George
  • 121
  • 2
  • 9
  • That doesn't help on Win8.1. Actually looking at the Process Explorer it seems that ALL the apps here are considered as DPI aware by default. The virtualisation doesn't kick up at all. – Evengard Mar 29 '15 at 05:02
  • What is your DPI scaling factor set to? The behavior you describe is what I'd expect to see if DPI scaling is set to 100%. I've tested this with success on Windows 8, 8.1, and 10. – George Mar 29 '15 at 16:04
  • Would love to see a one click converter. – Pui Ho Lam Aug 31 '16 at 05:10