Jump to content
Sign in to follow this  


Recommended Posts

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

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:


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

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  

  • Create New...