Hello!
I would like to set a timer on my VB prog so that If no acivity in the last 10 mins to give a message that the app will be closed down and if within 3 mins the person does not respond, the END
Has any 1 done this?
Printable View
Hello!
I would like to set a timer on my VB prog so that If no acivity in the last 10 mins to give a message that the app will be closed down and if within 3 mins the person does not respond, the END
Has any 1 done this?
*EDIT* neverminde here it is :)
VB Code:
Dim i As Integer Private Sub Form_Load() Timer1.Interval = 60000 i = 0 Timer1.Enabled = True End Sub Private Sub Timer1_Timer() i = i + 1 If i = 10 Then MsgBox "10 minutes have past!!!" End Sub
What type of activity is that?
see my edited post :p
You need to reset i everytime there is activity or it will close down in 10 minutes even if you are using it.
So you have to determine what is considered activity.
The minimum activity is moving the cursor...
Ok... The problem is not so much the timer implementation but rather checking for the "No Activity" at all in the app within that period of time... The minimum activity being any movement of the cursor in the app
Thanks
Problem with "no activity", Lafor, is that someone might not even use the mouse at all as keyboard could be used to navigate. So, having said that, you may need to implement some flags Set/Reset logic not only when user moves mouse (GetCursorPos api can be utilzed) but for every input field (textbox, combo, listboxes, etc) on your form as well. And this may become very hairy.
Thanks a lot Rhino and all of you!