Page 1 of 1

System Variable Idle Seconds

Posted: Thu Mar 02, 2006 6:41 am
by ahunkins
I have a Basic function that calculates idle time:
Private Type LASTINPUTINFO
   cbSize As Long
   dwTime As Long
End Type

Private Declare Function GetTickCount Lib "kernel32" () As Long
Private Declare Function GetLastInputInfo Lib "user32" (plii As Any) As Long

Sub Main
   Dim lii As LASTINPUTINFO

   lii.cbSize = Len(lii)
   Call GetLastInputInfo(lii)

RoboTaskApp.SetUserVariable "IDLE_SECONDS", Str((GetTickCount() - lii.dwTime) \ 1000)
End Sub
However, this would be more handy as a system variable.  I use it to tell when the user is using the computer again after a long idle.  So this would also make a nice trigger, like "On Wake Up" or some such name.  It would be nice not to have the computational overhead of the Basic Plug In every time you want to calculate this value.
Thanks!
 

System Variable Idle Seconds

Posted: Thu Mar 02, 2006 8:15 am
by Oleg
Good idea, but function GetLastInputInfo is supported by Windows 2000 or higher.

System Variable Idle Seconds

Posted: Fri Mar 10, 2006 7:16 am
by ahunkins
Does that mean, if you were to add the feature, I won't be able to use RoboTask with Windows 98?  Oh no!

System Variable Idle Seconds

Posted: Wed Mar 15, 2006 11:21 pm
by Oleg
Probably we will implement this feature in next release, but without of using of GetLastInputInfo function.