Jump to content
Sign in to follow this  
Dpg

Run screensaver after desktop is locked.

Recommended Posts

Dpg

Hi all.

Little backround info on why i try this.

We have an issue here with a mail notifier and the standard idletime from windows.
When we get a popup on the notifier the idletimer resets and the screensaver/lockscreen wont kick in after 10 minutes.(microsoft is looking into this for a few months now.) 

So i made a little script that runs on the timer in autoit. Works great, also added an tool to get the screen to go black.

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=lock-6.ico
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <Timers.au3>
#NoTrayIcon

Global $iLimit = 600; idle limit in seconds

HotKeySet("+!{ESC}", "_Quit") ;Shift-Alt-Esc

AdlibRegister("_CheckIdleTime", 500)

While 1
    Sleep(20)
WEnd

Func _CheckIdleTime()
    If _Timer_GetIdleTime() > $iLimit * 1000 Then
        DllCall('user32.dll', 'int', 'LockWorkStation')
        Run("C:\windows\nircmd.exe cmdwait 10 monitor off")
    EndIf
EndFunc   ;==>_CheckIdleTime.

Func _Quit()
    Exit
EndFunc   ;==>_Quit

So far so good.

Now we want to go from monitor off to an screensaver we build. An .scr file that counts the time someone left the workspace.

When i run that after the DllCall('user32.dll', 'int', 'LockWorkStation') then the lockscreen comes and the screensaver runs behind the lockscreen.

How can i put it on top of the lockscreen and still use the timer i use in the script?

Hope someone can help.

Share this post


Link to post
Share on other sites
CiVQ

Try Yashied's solution:

BR.

CiV.

Edited by CiVQ

I know that my code is ugly. But it works. Mostly.

Share this post


Link to post
Share on other sites
CiVQ

You're welcome :)


I know that my code is ugly. But it works. Mostly.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.