Switching display mode on locked workstation

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Timson
Posts: 2
Joined: 22 Jun 2018, 09:17

Switching display mode on locked workstation

13 Aug 2018, 02:36

Hello guys!

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
And I'm using this code to catch power wake up event:

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
}
However because my Windows account is password protected (and i want it this way) PC wakes up in locked state. And for some reason calling DisplaySwitch when PC is locked does't work. I'm sure the script catches the event immediately (I can hear test sounds when PC is still locked).
Can someone help me working around this issue?

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: mikeyww and 241 guests