Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determine if the system has been Idle for a while.
Message
 
 
To
31/10/2003 05:52:46
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00844861
Message ID:
00844896
Views:
13
>Hi,
>
>How can I determine if the system has been Idle for a while? I have a VFP8 application that should minimize if the user hasn't worked for a while, and upon activation display the Application's logon form.
>
>Anybody some idea's?
>
>TIA,
>

Stefan,
There is nothing in VFP by default to handle this. You have to build your own.

The basic concept:
1. Store time of last user action whenever they do something. You could have code in your subclasses (form, button, textbox, ...) when the control was used interactively (MouseMove, Click, InteractiveChange, etc.) to store this information as a global variable or a property of something your application object.
2. Create a system timer that checks this property against the current time. If the difference is greater than some value, then you can "logout" the current user. Or you could simply minimize the application, and display a modal login form in front of everything. If the user doesn't log back in, the form doesn't go away and they can't do anything.

HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Reply
Map
View

Click here to load this message in the networking platform