Idk if this is possible, but I would like it if the ahk script file is able to change its own properties to this when ran.
Much appreciated.
Or just to be able to override the system dpi scaling somehow? I don't want to do it manually and the system dpi scaling stuffs up the fonts.Override system dpi scaling.
Re: Override system dpi scaling.
So SeizeControl is a compiled script, and you want it to use the "System (Enhanced)" scaling mode automatically, without the user having to set it?
When you say "the system dpi scaling stuffs up the fonts", to what are you referring? The above setting is system DPI scaling.
AutoHotkey's GUI commands perform their own scaling of fonts and coordinates if you do not add the -DPIScale option to your GUI. This is not the system DPI scaling. Default font sizes are dependent on the DPI regardless of -DPIScale.
If you use multiple monitors and they have different DPI settings, I think the system scaling might kick in automatically because AutoHotkey is not "per-monitor DPI aware". But the system (non-enhanced) scaling doesn't do anything with fonts; it renders the window at its normal size (for the primary screen in our case) into an off-screen image, then scales the entire image to display on-screen.
You cannot effectively change the setting while AutoHotkey is running, as it does some initialization at startup that depends on its default DPI awareness - such as determining A_ScreenDPI. However, you can set the scaling mode for windows you create.
Each window uses whatever setting was current at the time the window was created.
If you are launching or reloading the script, you can override DPI awareness via the __COMPAT_LAYER environment variable (which is handled by the system):
When you say "the system dpi scaling stuffs up the fonts", to what are you referring? The above setting is system DPI scaling.
AutoHotkey's GUI commands perform their own scaling of fonts and coordinates if you do not add the -DPIScale option to your GUI. This is not the system DPI scaling. Default font sizes are dependent on the DPI regardless of -DPIScale.
If you use multiple monitors and they have different DPI settings, I think the system scaling might kick in automatically because AutoHotkey is not "per-monitor DPI aware". But the system (non-enhanced) scaling doesn't do anything with fonts; it renders the window at its normal size (for the primary screen in our case) into an off-screen image, then scales the entire image to display on-screen.
You cannot effectively change the setting while AutoHotkey is running, as it does some initialization at startup that depends on its default DPI awareness - such as determining A_ScreenDPI. However, you can set the scaling mode for windows you create.
Code: Select all
; DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED := -5
DllCall("SetThreadDpiAwarenessContext", "ptr", -5, "ptr")
Gui Add, Text,, This text should be scaled using the "System (Enhanced)" method.
Gui Add, Button, gExit, Exit
Gui Show
return
Exit:
ExitApp
If you are launching or reloading the script, you can override DPI awareness via the __COMPAT_LAYER environment variable (which is handled by the system):
Code: Select all
EnvGet compat_layer, __COMPAT_LAYER
if InStr(compat_layer, "GDIDPISCALING")
Gui Add, Text,, This text should be scaled using the "System (Enhanced)" method.
else
Gui Add, Text,, This text should be scaled using AutoHotkey's DPIScale.
Gui Add, Button, gReload, Reload
Gui Show
return
Reload:
EnvSet __COMPAT_LAYER, GDIDPISCALING
Reload