2

I know that I can use GetProcessDpiAwareness() to check the dpi awareness of a particular process. However this is only supported from Windows 8.1 upwards. Is there any way to query the dpi awareness of a process prior to that? I couldn't find any information about it.

Particularly I want to know if the process was ran with [x] Disable display scaling on high DPI settings (which was available at least from Windows 7.

Johannes Stricker
  • 1,701
  • 13
  • 23
  • 2
    There is [`IsProcessDPIAware()`](https://learn.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-isprocessdpiaware), available since Windows Vista, but it only works for the current process. – zett42 Sep 10 '18 at 16:07
  • Thank you. I'm looking for a method that works for other processes as well, though. – Johannes Stricker Sep 10 '18 at 21:18

1 Answers1

5

When you check the "Disable display scaling on high DPI settings" checkbox on Windows 7 (and 8) that setting is stored in the registry, by creating a key the name of which is the fully qualified path to the executable under HKCU\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers and the content of which is:

  • HIGHDPIAWARE to enable display scaling
  • ~ HIGHDPIAWARE to explicitly disable display scaling

So you could simply look up that registry key to see whether display scaling was enabled or disabled for the process.

mnistic
  • 10,866
  • 2
  • 19
  • 33