Code Monkey home page Code Monkey logo

setdpi's People

Contributors

antonwetzel avatar imniko avatar lesferch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

setdpi's Issues

Please add a licence to the project

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!

Bug: Monitor numbering mismatch

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?

Monitor config

Also I want to mention I really appreciate this app. The lack of a proper API for this makes no sense.

Questions!!??

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.

Automatically adjust the resolution, depending on the connected displays

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")
}

Access is denied

New version 1.0 doesn't work on Windows 10 64 Enterprise. Version 0.2 is working ok.

kuva

kuva

Windows 10 support

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)
image

I don't have an option to update the machines.

Is this intended?

Update AHK to v2

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"
}

Option to display current dpi value

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?

Can this be used together with Powershell / UI?

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?

Feature Request: Make it into a library.

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....

System Error

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)

AHK Key shortcut comments don't match actual hotkey

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.

Explorer crashes after run

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.