Idle Auto away
No attachments for this post
this code show how to make an Auto Away like ICQ with Windows Api call GetLastInputInfo. Only work on Nt, 2000, and Xp not on 98,me...
Original Author: Frédéric Thibault
The value return to dwtime is the last time when the user move the mouse or use the keyboard. The time begin when the session is open.
Put a Timer and a textbox on a form. Name the textbox text1 and timer timer1 and copy and past this code.
Private Type tagLASTINPUTINFO
cbSize As Long
dwTime As Long
Private Declare Function GetLastInputInfo Lib "user32" (ByRef LASTINPUTINFO As tagLASTINPUTINFO) As Long
Private Sub Timer1_Timer()
Dim mLast As tagLASTINPUTINFO
mLast.cbSize = Len(mLast)
Me.Text1.Text = mLast.dwTime
Comments on this post
No comments have been added for this post.
You must be logged in to make a comment.