1

With great effort I have migrated my MFC application from begin Sytem DPI aware (High DPI aware) to Per Monitor High DPI Aware. I see that the MFC components that I have used like Dialog boxes, message boxes, etc. are still not per-monitor-dpi aware, instead they still behave as if they are system-dpi aware. Now with Windows DPI virtualization gone, these components are displayed even worse when different monitors of my machine have different DPI scaling.

For eg.
Consider 2 monitors M1 (3840x2160 with 150% dpi scaling), and M2 (1280x1024 with 100% DPI scaling). Now when my app runs on M2, a Dialog box to select color which used to fit on M2, doesn't fit on it (earlier Windows OS used to shrink it down due to DPI virtualization).

Are there any new MFC components which were introduced Windows 8 onward, which are per-monitor-dpi aware? for eg. a DIALOGEX2 instead of DIALOGEX?

Sahil Singh
  • 3,352
  • 39
  • 62
  • Hi, thanks, that video gives nice insight. However, I can see that the `DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2` is available post creator's update only. I have to support my application on all OS from Windows 7 to latest Windows 10 version. Will do investigation and get back to you. – Sahil Singh Aug 16 '17 at 09:34
  • I do not think there's any solution for old versions of Windows. – Martin Prikryl Aug 16 '17 at 09:35
  • i just played around with an MFC app changing it to per monitor, interestingly my CListView handled the change (titlebar / the list view were good), just the toolbar and menubar weren't changed. What method did you use to convert over to rebuild toolbar/menubar? – df234987 Jun 22 '20 at 23:17
  • You can try `DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2`. There are various types of per monitor DPI awareness. And they have different behavior - https://learn.microsoft.com/en-us/windows/win32/hidpi/dpi-awareness-context . Eg. Whether non client area scaling is handled by OS or not, etc. – Sahil Singh Jun 23 '20 at 19:24

0 Answers0