Sign in to follow this  
Followers 0
killroy

Screensaver Type timeout

4 posts in this topic

Greetings everyone,

Quick one, has AutoIT got the ability to run as a background process which would wait for a timeout (similar to that of a screensaver).

Let me try and give you an example,

I require a background process which will run an application after a specified time has passed if there is no mouse movement. I need to run a Powerpoint presentation as a screensaver on my network and after spending the morning and afternoon searching through websites for the answer it suddenly dawned on me to try the brilliant AutoIT!

I look forward to your reponses with great anticipation.

Thank you.

Byron

Share this post


Link to post
Share on other sites



you can loop until MouseGetPos() returns the same result.

<{POST_SNAPBACK}>

Hey, sorry to be a lazy boy but would you mind giving me a little tiny example. I will take what you give me and go from there, I hope :)

Share this post


Link to post
Share on other sites

$TimeOut_ms = 5 * 1000 * 60 ; 5 minutes
Global $CurMsPos
$TRUE = 1

Func TimeOutAction()
    While 1
        If $CurMsPos <> MouseGetPos() Then
            Return $TRUE
        EndIf
    ;Do TimeOut behavior
        Sleep(100) ;If TimeOut behavior does not provide necessary delay
    WEnd
EndFunc  ;==>TimeOutAction

While 1
    $CurMsPos = MouseGetPos()
    Sleep($TimeOut_ms)
    If $CurMsPos = MouseGetPos() Then
        If TimeOutAction() Then
        EndIf
    EndIf
WEnd

not tested

J


If I am too verbose, just say so. You don't need to run on and on.

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  
Followers 0