|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
Session timeout on inactivity
Hi All,
I m looking for a VB5.0 code or function which can will do timeout after 30 minutes of inactivity. I have this VB5 application and am working on an NT machine. I am using a code which does this ------------------------------------------------------------------------------------- Private Declare Function GetQueueStatus Lib "user32" (ByVal fuFlags As Long) As Long Private Const QS_KEY = &H1 Private Const QS_MOUSEMOVE = &H2 Private Const QS_MOUSEBUTTON = &H4 Private Const QS_MOUSE = (QS_MOUSEMOVE Or QS_MOUSEBUTTON) Private Const QS_INPUT = (QS_MOUSE Or QS_KEY) Public bCancel As Boolean Public Sub CheckInputIdle(ByVal TimeOut_InSec As Long) Dim t As Long t = Timer Do While bCancel = False If GetQueueStatus(QS_INPUT) Then t = Timer DoEvents End If If Timer - t >= TimeOut_InSec Then Exit Do Loop If bCancel = False Then MsgBox "Process idle is for " & Timer - t & " sec." End If End Sub '======Form code (or Sub Main())=== Private Sub Form_Load() Me.Show 'Force to show window CheckInputIdle 3 End Sub Private Sub Form_Unload(Cancel As Integer) bCancel = True End Sub --------------------------------------------------------------------------------------------- This is a working form. But in my application , I have a MDI form, in which I am calling the CheckInputIdle function.....and the parent form is then controlling the timeout for child forms too. The only problem with the above code is my application hangs when minimised . I am not able to figure out why......Is it not able to recognise the keys when minimised? Is there an alternative for this code? Thanks and Regards Chitra |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Session timeout on inactivity |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|