Sign in to follow this  
Followers 0
lod3n

_IdleTicks()

3 posts in this topic

I am new to the forum, so I thought I'd contribute something. Enjoy.

func _IdleTicks()
    Local $aTSB, $ticksSinceBoot, $struct, $ticksSinceIdle
    
    $aTSB = DllCall ("kernel32.dll", "long", "GetTickCount")
    $ticksSinceBoot = $aTSB[0]
    
    $struct = DllStructCreate("uint;dword");
    DllStructSetData($struct, 1, DllStructGetSize($struct));
    DllCall("user32.dll", "int", "GetLastInputInfo", "ptr", DllStructGetPtr($struct))
    $ticksSinceIdle = DllStructGetData($struct, 2)
    
    return $ticksSinceBoot - $ticksSinceIdle
endfunc

[font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font]

Share this post


Link to post
Share on other sites



Yes, that looks familiar. Thank you. I forgot where I got that. You provided the GetLastInputInfo part, and ezzetabi provided the GetTickCount part:

http://www.autoitscript.com/forum/index.ph...hl=GetTickCount

My apologies for not originally providing due credit and links to the original sources. I will make sure I do so in the future.


[font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font]

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