Skip to main content

One post tagged with "c#"

View All Tags

Deep Dive: Fixing DPI Scaling for Embedded Processes in WPF

· 7 min read
BornToBeRoot
Maintainer of NETworkManager

Modern Windows setups with multiple monitors at different scale factors (100 %, 125 %, 150 %, …) expose a hard Win32 limitation the moment you embed a foreign process window into your own application via SetParent. Windows simply does not forward WM_DPICHANGED across process boundaries.

This article documents the investigation and the two different solutions NETworkManager uses for its embedded PowerShell (a console host process) and PuTTY (a GUI process) tabs — together with the complete, relevant C# source code.