tpiper Posted December 7, 2010 Report Share Posted December 7, 2010 I'm looking for a way to detect if a program is in use, and if it hasn't been used for say, 15 minutes, then it would shut down. I'm able to time the program but can't seem to get my mind around how to detect user activity within the program (keystrokes, mouse movement, etc.), not just that it's focused are is running in the background. Any thoughts would be greatly appreciated! Thanks Quote Link to comment Share on other sites More sharing options...
Cory Posted December 7, 2010 Report Share Posted December 7, 2010 There may be a way to get the system idle timer value in a VBScript. That is the timer used to control if the screensaver should come on and so forth. That combined with that application being on top might work. The other thought I had would only work if the user is using their mouse. You could create a macro that activates when that application is focused and then periodically checks the mouse position. If it checks every 10 seconds, say, and after 30 iterations (5 minutes) it never changed kill the window. And if the program or window loses focus kill the macro. You could also do something similar with changing controls. IE if windows and controls come and go as the user is going thru different forms or what have you they will change and you could use timing with the appearance and or disappearance of those controls. Quote Link to comment Share on other sites More sharing options...
tpiper Posted December 7, 2010 Author Report Share Posted December 7, 2010 Cory, I appreciate quick reply. The second option sounds good because I'm not real familiar with VBscript. Also could you expand a little more on changing controls? Thanks, Tom Quote Link to comment Share on other sites More sharing options...
Cory Posted December 7, 2010 Report Share Posted December 7, 2010 Regarding controls I was thinking something like this: Suppose the application has a main page with buttons and controls and the user does things like create new record or whatever that change the controls. EG they do data entry where they work from a search form then navigate to an entry form with different controls. The appearance, disappearance or persistence of these controls could be used to infer activity. Quote Link to comment Share on other sites More sharing options...
tpiper Posted December 7, 2010 Author Report Share Posted December 7, 2010 Cory, thanks for the explanation. That helps. Tom Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.