I'm writing a window manager/snapper, and I noticed that when I have two screens with different DPI values, when I move windows using "WinMove", some windows start to automatically resize uncontrollably as soon as they start touching the other screen (ex: Chrome). On the other hand, other applications like Notepad++ behave as expected, keeping their initial size.
When I add this DllCall, the behaviors are reversed (chrome not resizing, but Notepad++ resizing):
DllCall("SetThreadDpiAwarenessContext", "ptr", -4, "ptr")
This behavior seems to be because Notepad++ is not DPI-aware while chrome is.
Is there a way to know if a given process/window is DPI-aware or not, so that I can fix my code with something like this:
Code: Select all
WinGet, Style, Style, ahk_id %window_id%
if ((DPIAware=1) and (Style & 0x40000))
DllCall("SetThreadDpiAwarenessContext", "ptr", -4, "ptr")
Else
DllCall("SetThreadDpiAwarenessContext", "ptr", -1, "ptr")
Any help would be appreciated