|
-
Oct 17th, 2006, 12:19 AM
#1
Thread Starter
Fanatic Member
application idle
how to recognize that an application is idle for some time interval ?
for example i have an application made in vb. some times users keep it open and go some other place.
i want a way to recognize that my application is in idle position for say 1/2 hr or more.
i.e it is just opened but not have any action on it in some interval.
WHETHER YOU SUCCEED OR FAIL IS NOT AS IMPORTANT AS WHETHER YOU TRIED YOUR BEST 
-
Oct 17th, 2006, 01:02 AM
#2
-
Oct 17th, 2006, 01:30 AM
#3
Thread Starter
Fanatic Member
Re: application idle
thanks. danasegarane.
but on which form event should i write this. because i m having MDI interface.
many forms.
WHETHER YOU SUCCEED OR FAIL IS NOT AS IMPORTANT AS WHETHER YOU TRIED YOUR BEST 
-
Oct 17th, 2006, 01:33 AM
#4
Re: application idle
Write on the Main form Event
-
Oct 17th, 2006, 01:38 AM
#5
Thread Starter
Fanatic Member
WHETHER YOU SUCCEED OR FAIL IS NOT AS IMPORTANT AS WHETHER YOU TRIED YOUR BEST 
-
Oct 17th, 2006, 01:51 AM
#6
Re: application idle
Here is another way:
VB Code:
'Create a new project with a timer control
Option Explicit
Private Type LASTINPUTINFO
cbSize As Long
dwTime As Long
End Type
Private Declare Function GetLastInputInfo Lib "user32" (plii As Any) As Long
Dim test As Long
Private Sub Timer1_Timer()
Dim lii As LASTINPUTINFO
lii.cbSize = Len(lii)
Call GetLastInputInfo(lii)
If test = lii.dwTime Then
Debug.Print "Idle " & Format$(Now, "dd-mmm-yyyy HH:mm:ss")
Else
Debug.Print "Not Idle " & Format$(Now, "dd-mmm-yyyy HH:mm:ss")
End If
test = lii.dwTime
End Sub
-
Oct 17th, 2006, 02:35 AM
#7
Thread Starter
Fanatic Member
WHETHER YOU SUCCEED OR FAIL IS NOT AS IMPORTANT AS WHETHER YOU TRIED YOUR BEST 
-
Oct 17th, 2006, 02:52 AM
#8
Re: application idle
When you have received an answer to your question, please mark it as Resolved using the Thread Tools menu.
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
|