System Variable Idle Seconds

Post comments and suggestions for RoboTask here
Post Reply
ahunkins
Posts: 24
Joined: Wed Dec 15, 2004 7:37 am

System Variable Idle Seconds

Post 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!
 
Oleg
Site Admin
Posts: 3136
Joined: Thu Jan 01, 1970 1:00 am
Contact:

System Variable Idle Seconds

Post by Oleg »

Good idea, but function GetLastInputInfo is supported by Windows 2000 or higher.
ahunkins
Posts: 24
Joined: Wed Dec 15, 2004 7:37 am

System Variable Idle Seconds

Post 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!
Last edited by ahunkins on Fri Mar 10, 2006 11:18 am, edited 1 time in total.
Oleg
Site Admin
Posts: 3136
Joined: Thu Jan 01, 1970 1:00 am
Contact:

System Variable Idle Seconds

Post by Oleg »

Probably we will implement this feature in next release, but without of using of GetLastInputInfo function.
Post Reply