Script Won't Run with Monitors Off Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
Vaklev
Posts: 47
Joined: 04 Mar 2019, 13:58

Script Won't Run with Monitors Off

Post by Vaklev » 13 Aug 2019, 09:21

Hi guys, I made a script to lock windows within 5 mins, what I like to do is turn off my monitors and walk away from my desk, and then running the following script with a 5 minute wait time before the lock windows is executed. However it doesn't seem to work when the monitors are off, it only starts the timer once I turn the monitors back on but I am already at my desk!

Code: Select all

^j::
MsgBox Locking Windows in 5 min.
sleep 300000
DllCall("LockWorkStation")
return
Please help :)

User avatar
Nextron
Posts: 1378
Joined: 01 Oct 2013, 08:23
Location: Netherlands OS: Win10 AHK: Unicode x32

Re: Script Won't Run with Monitors Off  Topic is solved

Post by Nextron » 13 Aug 2019, 09:51

The five minute wait starts after you dismiss the message box. Could it be that you only do that when you see it with a monitor that's on?

Vaklev
Posts: 47
Joined: 04 Mar 2019, 13:58

Re: Script Won't Run with Monitors Off

Post by Vaklev » 13 Aug 2019, 10:17

Nextron wrote:
13 Aug 2019, 09:51
The five minute wait starts after you dismiss the message box. Could it be that you only do that when you see it with a monitor that's on?
You are 100% correct sir! Thank you! No wonder it was working before I added the msgbox and then it wasn't, I will just add a command to close the msgbox within 5 seconds of opening thank you!

Post Reply

Return to “Ask For Help”