Windows – RemoteApp doesn’t apply correct scaling initially

high-dpiremote desktopscalingwindows 10windows-server-2016

I have a large app that we are delaying supporting dynamic DPI for. Currently, when we launch our app via RemoteApp (RDP to our Windows Server 2016 server) on a high DPI screen, the text and controls overlap.

As a work around for our customers with high DPI displays, we found the best solution is to set HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\IgnoreClientDesktopScaleFactor to 1. This stops the RemoteApp from using DPI scaling and makes it look decent.

The problem is that the size of the window itself starts off super tiny.
Example 1

If you change the scaling factor on the local PC and then change it back, it will automatically size the window back up to the correct scaling.
Example 2
Example 3

We would prefer to use this workaround instead of adding a mstsc manifest file to our customers' PC's, but we would need to know how to force the scaling to start off with the local PC's settings while still avoiding DPI scaling.

Best Answer

When doing RDP from a high-DPI client monitor into a low-DPI server, the problem is that the RDP window doesn’t scale up, representing the screen pixel by pixel, so making everything tiny and unreadable.

In the article Remote Desktop client on HiDPI (Retina) displays: Work around pixel scaling issues, the author, Chris K., presents the solution of disabling HiDPI scaling for mstsc2.exe using AppCompatFlags. As this is impossible to do for a system executable, he proposes the simple solution of creating a copy of mstsc.exe (called mstsc2.exe).

In an elevated (admin) cmd shell, create a copy of mstsc.exe and mstsc.exe.mui, where the en-us part corresponds to the installed language:

cd %systemroot%\system32
copy mstsc.exe mstsc2.exe
cd %systemroot%\system32\en-us\
copy mstsc.exe.mui mstsc2.exe.mui

Then to set the AppCompatFlag for all users for mstsc2.exe:

reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /t REG_SZ /v "C:\Windows\System32\mstsc2.exe" /d "~ DPIUNAWARE" /f

Now one should be able to start mstsc2.exe and connect to the remote host with no scaling issues.