Open johannes-z opened 5 years ago
I found this reddit thread (https://www.reddit.com/r/Batch/comments/4665jq/how_to_change_windows_10_display_scaling_via/) explaining how to read per monitor dpi values. AHK can only read the primary display's dpi value...
@johannes-z were you able to come up with a fix?
I am getting the same issue with 2 1920x1080p monitors where WindowPad is not moving the window into the corner perfectly.
@alapo Hi, I think this is another problem. And no, I did not find a universal solution for windows without borders. I tried a few variants by now, but couldn't find an option that works for all types of windows...
To make WPXA_Move size the windows correctly on monitors with different DPI than the main monitor, call:
originalContext := DllCall("SetThreadDpiAwarenessContext", "ptr", -3, "ptr")
at the top of WPXA_Move
and DllCall("SetThreadDpiAwarenessContext", "ptr", originalContext, "ptr")
at the bottom of this function.
(Optionally just call the first function once when starting WindowPadX).
There are also other ways to solve this (see first link under refrences).
Refrences:
SetThreadDpiAwarenessContext documentation - from Microsoft Description of function argument (enum value) - from Microsoft
To make WPXA_Move size the windows correctly on monitors with different DPI than the main monitor, call:
originalContext := DllCall("SetThreadDpiAwarenessContext", "ptr", -3, "ptr")
at the top of WPXA_Move andDllCall("SetThreadDpiAwarenessContext", "ptr", originalContext, "ptr")
at the bottom of this function.(Optionally just call the first function once when starting WindowPadX).
There are also other ways to solve this (see first link under refrences).
Refrences:
SetThreadDpiAwarenessContext documentation - from Microsoft Description of function argument (enum value) - from Microsoft
Thanks for your answer @BjAlvestad just wanted to confirm that within WPXA.ahk
I insert it before the if
statements shown in figure below.
and your second slice of code on line 1216
I tried this and I still get issues as shown in the screenshots in my previous post. I did want to comment that if I press Win+Left
(the default for half screen in Windows) then I do not have a gap in the windows. Both my monitors are 1920x1080p
When I enable DPI scaling > 100%, the positioning and the window size is wrong. Does somebody have a fix for that?