I know this is an older post - but I'm wondering if you refined this at all over the last year.
I want to create a script to switch between my one monitor's native resolution, and then when I connect via Splashtop from my ipad pro 12.9 to set the resolution to the ipad's native rez, and then change scaling to 200%.
Right now, my research is that scaling values are not absolute, even when you call the registry setting here - they seem to be incremental. With the script below, I can toggle to IPP native rez, and 60hz. First time I toggle it, it will jump to 150% scaling, then I can hit the hotkey again to bump up to 200%. It won't go higher than 200%.
When I quit splashtop remote session, I can sit down at my computer and hit the hotkey combo twice to restore it to 1440P and 100% scaling. Again, it takes two calls of the script to get to the scaling I desire. I'm trying to figure out how to automate this as putting in different values for the DPIVALUE do not really seem to result in any absolute jumps to a specific scaling factor. For example, if I use 4 when jumping to the ipad pro rez - it will actually jump to 250%. Right now -2 and 2 on DPIVALUE work ok, just takes two toggles of the hotkey. I'm going to keep working on it- probably just repeat the regedit call twice on hotkey toggle? However, it would be much nicer if there was just a way to set an absolute scaling value. <br/>
Code: Select all
</i>#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
^[::
ChangeResolution(32,2560, 1440,95)
RegWrite, REG_DWORD, HKEY_CURRENT_USER\Control Panel\Desktop\PerMonitorSettings\WAM27000_01_07E3_75^5C7D7FCD16ED5791FB8067EEC72B6B69, DpiValue, -3
; RegWrite, REG_DWORD, HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\GraphicsDrivers\ScaleFactors\WAM27000_01_07E3_75^5C7D7FCD16ED5791FB8067EEC72B6B69, DpiValue, -1
Return
^]::
ChangeResolution(32,2732,2048,60)
RegWrite, REG_DWORD, HKEY_CURRENT_USER\Control Panel\Desktop\PerMonitorSettings\WAM27000_01_07E3_75^5C7D7FCD16ED5791FB8067EEC72B6B69, DpiValue, 2
; RegWrite, REG_DWORD, HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\GraphicsDrivers\ScaleFactors\WAM27000_01_07E3_75^5C7D7FCD16ED5791FB8067EEC72B6B69, DpiValue, 3
Return
ChangeResolution( cD, sW, sH, rR )
{
VarSetCapacity(dM,156,0), NumPut(156,2,&dM,36)
DllCall( "EnumDisplaySettingsA", UInt,0, UInt,-1, UInt,&dM ),
NumPut(0x5c0000,dM,40) NumPut(cD,dM,104), NumPut(sW,dM,108), NumPut(sH,dM,112), NumPut(rR,dM,120)
Return DllCall( "ChangeDisplaySettingsA", UInt,&dM, UInt,0 )
}