|
-
Mar 26th, 2004, 10:02 AM
#1
Thread Starter
Fanatic Member
Timer
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?
-
Mar 26th, 2004, 10:05 AM
#2
Hyperactive Member
*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
-
Mar 26th, 2004, 10:07 AM
#3
What type of activity is that?
-
Mar 26th, 2004, 10:10 AM
#4
Hyperactive Member
see my edited post
-
Mar 26th, 2004, 10:16 AM
#5
Frenzied Member
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.
-
Mar 26th, 2004, 10:20 AM
#6
Thread Starter
Fanatic Member
Thanks to all
The minimum activity is moving the cursor...
-
Mar 26th, 2004, 10:23 AM
#7
Thread Starter
Fanatic Member
...Thanks
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
-
Mar 26th, 2004, 10:33 AM
#8
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.
-
Mar 26th, 2004, 10:48 AM
#9
Thread Starter
Fanatic Member
Thus my question
Thanks a lot Rhino and all of you!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|