imniko / setdpi Goto Github PK
View Code? Open in Web Editor NEWLicense: The Unlicense
License: The Unlicense
Windows 11 supports a custom scale factor. The application should be updated to support it.
Just found your very useful tool and would like to make use of it in my own project.
However, since there's currently no license set I would really appreciate it if you could set a licence for it so any use would be legal.
Many thanks!
I have the monitor config shown and I want to change monitor 1. Inputting "1" ends up changing monitor 3. Inputting "2" changes monitor 1. Maybe Microsoft changed the way numbers are reported at some point?
Also I want to mention I really appreciate this app. The lack of a proper API for this makes no sense.
Hi folks. Just stumbled on this while looking to see monitor scaling possibilities. Here is my situation.
I have a Lenovo laptop, 1920 x 1080 connected to a doc connected to an external monitor 2560 x 1440. The external is primary. Everything works as expected, BUT, I have displays set to duplicate and if I open the laptop lid it shows the higher res external layout perfectly. It is higher than native resolution and appears to be scaled at 75% as it is showing the 2560 perfectly in 1920.
Will this allow me to get that without being docked and duplicated?
Is this a run once and done so the laptop internal then will always be showing more information than native?
Is there any risk?
I "assume" I put the exe in a directory and then cd to it and run the command line.
Looking forward to knowing if I should try this and exactly how.
Thanks.
Hi there,
many thanks for that little helper, I always looked for a way to automate the scaling of my laptop depending on the connected state of the hdmi output. I scale it to 150% if it's next to my external display, as it's further away.
I just wanted to share my ahk
script, maybe it's useful to others.
#Requires AutoHotkey v2.0
; requires setDpi.exe in $PATH https://github.com/imniko/SetDPI/
OnMessage 0x007E, OnDisplayChange ; System Event: Display changes
Persistent
OnDisplayChange(wParam, lParam, *)
{
scale_connected := 150
scale_solo := 100
display_lg := "\\.\DISPLAY4"
; display_internal := "\\.\DISPLAY1"
; Determine the scale based on the primary monitor
; TODO: find a more stable property
new_scale := MonitorGetName() == display_lg ? scale_connected : scale_solo
Sleep 1000 ; setDpi needs to be delayed a little bit, otherwise explorer.exe crashes
Run("setDpi.exe " . new_scale . " 1")
}
Greetings.
I seem to have an issue with using this on Win10, but I can get it to work on WIn11, whereas the windows-DPI-scaling-sample project seems to work on both
On Win10, I just get an empty/blank output - tested on 2 win10 machines running 1607 and 1809 (so older releases)
I don't have an option to update the machines.
Is this intended?
: (
The highest DPI can be set by setDpi.exe seems to be constrained to 250 on Windows 11
Here is the AHK updated to version v2.
current_scale := 100 ; scale value you are currently in
next_scale := 150 ; scale value you want to switch to next
is_scaled := 0
; Ctrl + Win + F1 toggles main monitor between 2 scale values
^#F1::
{
global is_scaled
global next_scale
global current_scale
if(is_scaled == 0)
{
Run "SetDpi.exe " next_scale
}
else
{
Run "SetDpi.exe " current_scale
}
is_scaled := !is_scaled
}
; Ctrl + Win + F2 sets 2nd monitor to a scale of 150
^#F2::
{
Run "SetDpi.exe 2 150"
}
Hi! Must say... I love the utility. I was looking for a way to change the dpi setting from command line for quite some time now and then I found your utility. I want to use it in an AHK script. Could you add an option to output the current dpi value?
I love this tool, but I want to write a sort of UI via Powershell so I can make an .exe with an UI so my students don't have to go into the command line.
Is there an easy way to do this? Or a better way compared to Powershell?
Hi,
I would like to use the SetDPI functionality, but I would like to use it in a C# application/solution. Is there a way to get this tool to be a (DLL-) library project that I can reference in my C# solution? That way, I can call the appropriate methods from my own application. Perhaps this would require another repo....
Program doesn't work in Windows 11 26231.5000. No matter what parameters you put in, you get an invisible dialog that when hovering over the window says "System Error" and repeats 3 times...
I tried:
SetDpi.exe get 1
SetDPI.exe 125
Both produce same error :( (3 times over again each)
Is there any way to make you a donation? ( e.g.: buymeacoffee.com )
In the AutoHotKey script included, there are two hotkeys:
AHK code | Key combination |
---|---|
^#F1:: |
Ctrl + Win + F1 |
^#F2:: |
Ctrl + Win + F2 |
However the comments above each suggest a different key combo.
; win + alt + F1 toggles main monitor between 2 scale values
^#F1::
and
; win + alt + F2 sets 2nd monitor to a scale of 150
^#F2::
This is confusing for someone trying to get this to work after downloading. The comments should match the coded shortcuts.
This works for me, but a few seconds after it changes the scaling, Explorer crashes.
Any logs or such that I could refer to? It just silently crashes and then works fine after.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.