1

I have a 14" 1920×1080 laptop and a 24" 1920×1200 screen. The pixel density difference is huge.

When I'm using the large screen as a main one and laptop as an additional screen, I'd like to have the smaller one set to 150% scaling so that I can use it comfortably. But when I'm away from my desk and the external screen is disconnected, I'd like the laptop to automatically switch to 100% scaling to maximize desktop area.

How can I make Windows switch DPI scaling automatically when external screens are connected or disconnected?

I'm okay with using 3rd party software if it's necessary, but I'd rather stick to built-in features of Windows.

I'm using Windows 10 Pro Version 1703.

  • I don't think there is any Windows feature to do what you want. How badly do you want it? You might be able to do something with powershell, but it will likely be monstrously over complicated. – ben_re Jul 17 '17 at 18:42
  • 1
    @lifesaspanner Well, I've priced my need for it at 50 reputation points paid with a bounty ;) It could be useful for me, but I don't have a burning need for it. – gronostaj Jul 17 '17 at 19:04
  • @gronostaj I'm currently working on a similar project using batch files to call powershell scripts, but mine concerns monitor brightness. I should have it nailed down by early next week, so if there isn't an answer at that point I will at least share my research and process with you. This should absolutely be able to be done through powershell, but it will be a pain in your behind. – jcam3 Jul 19 '17 at 14:10
  • @jcam3 That may be interesting to look at! If that's of any use to you, ScreenBright can control screen brightness of external displays via DDC/CI and has command-line interface. I'm using it with SE-TrayMenu to control brightness from the notification area. – gronostaj Jul 19 '17 at 14:21
  • 1
    @gronostaj I'll have to take a closer look at that application, looks interesting. What I'm trying to do is basically a 3-5 second brightness reduction looped every 20 minutes or so. The idea is to have an automatic non-intrusive reminder to take a screen break now and then for eye strain relief. Has potential for a pomodoro-style application too, but have to get it working first. – jcam3 Jul 19 '17 at 14:39
1

You can't change DPI scaling automatically because it requires you to logoff and logon.

Here's a good thread on using powershell to set the DPI registry key and toggle back and forth between two DPIs a little quicker. You still have to logoff, and the script automates that.

https://stackoverflow.com/questions/10365394/change-windows-font-size-dpi-in-powershell

If you want to expand on this, here is information about reading monitor information with Powershell: https://blogs.technet.microsoft.com/heyscriptingguy/2013/10/03/use-powershell-to-discover-multi-monitor-information/

And, here is information about changing the registry key of a specific user. This will be needed because if you run your script while you are not logged on, or during startup your registry hive will not be loaded. https://www.pdq.com/blog/modifying-the-registry-of-another-user/

Combine it all together with some ingenuity and you could schedule this script to run on logoff and on computer startup. The tricky part is that you will always have to be doing a new logon to get the new settings to take effect and to me, that is the biggest drawback about this.

Now, a better solution might be to change the actual display resolution which can be done without logging off: https://blogs.technet.microsoft.com/heyscriptingguy/2010/07/07/hey-scripting-guy-how-can-i-change-my-desktop-monitor-resolution-via-windows-powershell/

A lot of programs do not function properly with a non-standard DPI, and so if you ask me, changing the display resolution is a better solution.

So there you have it. All the resources to create your new script to automate this. Now you can see if you can get anybody over at http://stackoverflow.com to help you with it. :)

  • “You can't change DPI scaling automatically because it requires you to logoff and logon.” That’s no longer true. It only applies to legacy scaling. Windows 10 can change scaling on the fly. – Daniel B Jul 22 '17 at 17:44
  • Sorry but you are wrong about this. Windows always adjusts the DPI but then indicates you have to sign-out to complete the change. Try it, you'll see. Just confirmed it myself on Windows 10. – Appleoddity Jul 22 '17 at 18:15
  • 1
    More specifically, the message reads: “Some apps won’t respond to scaling until you sign out.” – And that’s how it is. It scales instantly. Most programs respond correctly. Few do not. – Daniel B Jul 22 '17 at 18:46
  • Fair enough. But, I have been unable to locate an API to modify DPI and I am only assuming it is because of the requirement to logoff and logon (even if only for certain apps) and the incompatibility that some programs do exhibit. – Appleoddity Jul 23 '17 at 18:01
  • Logging off is not an option for me, it would interrupt my workflow. I want DPI to change seamlessly when screen setup changes. – gronostaj Jul 25 '17 at 8:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.