hi
i want to knw that three has been no mouse movents or no key strokes for a particular interval lets say 2 minutes, in other words i want to knw if system remain idle for this interval ...
Printable View
hi
i want to knw that three has been no mouse movents or no key strokes for a particular interval lets say 2 minutes, in other words i want to knw if system remain idle for this interval ...
you could use a timer, but you'd have to start it.
hey wat do u mean by that ... pls elaborate !
It's not as simple as it may sounds - system wide hook will need to be created if you want it to work "properly".
If you want to get an idea of how complicated this could be - take alook at this sample project from vbaccelerator .
Good luck.
well i also found some module code to get mouse n key strokes n it said that use a timer to control its timings now, i tried using timer with 10 seconds interval but i think it does not return proper value. here is da code
Option Explicit
Private Type POINTAPI
x As Integer
y As Integer
End Type
Private Declare Sub GetCursorPos Lib "user32.dll" (lpPoint As POINTAPI)
Private Declare Function GetAsyncKeyState Lib "user32.dll" (ByVal vKey As Long) As Integer
Private posOld As POINTAPI
Private posNew As POINTAPI
'------------------------------
'Now create a new function in MoveDetect
'-------------------------------
Public Function InputCheck() As Boolean
Dim i As Integer
'Get the current mouse cursor coordinates
Call GetCursorPos(posNew)
'Compare with old coordinates
If ((posNew.x <> posOld.x) Or (posNew.y <> posOld.y)) Then
posOld = posNew
InputCheck = True
Exit Function
End If
'Check keys state
For i = 0 To 255
If (GetAsyncKeyState(i) And &H8001) <> 0 Then
InputCheck = True
Exit Function
End If
Next i
InputCheck = False
End Function