I'm trying to write a script that switches multiple displays mode to "clone" whenever PC wakes from sleep mode on Windows 10 machine.
I'm using this line to do the switching and it's works on it's on (if I bind it to a key event):
Code: Select all
Run %A_WinDir%\Sysnative\DisplaySwitch.exe /clone
Code: Select all
OnMessage(536, "OnPBMsg")
Return
OnPBMsg(wParam, lParam, msg, hwnd) {
If (wParam = 7) ;PBT_APMRESUMESUSPEND
;MsgBox The computer is now resuming from a suspended state.
Run %A_WinDir%\Sysnative\DisplaySwitch.exe /clone
Return True
}
Can someone help me working around this issue?