Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
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  
Old March 10th, 2004, 10:45 PM
chitras91 chitras91 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 1 chitras91 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Session timeout on inactivity


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway