Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
A Global Timer since last User's Input
Message
From
18/05/2004 03:48:25
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00897805
Message ID:
00904812
Views:
23
>I appreciate the response.
>
>As far as the implementation, am I right in assuming ?:
>
>I have to have ONE active form that is always running (open) with a timer that checks the Inactivity (using this code) and after so many seconds of inactivity, it externally executes the click methods of all the Exit buttons on all active forms to close them.... Is this how you recommend it ?
>
>Thank you again, Cetin.

You might or might not have a form open all the time. It's VFP that's open with a timer (or a form with a timer - up to you).
Basically what you do is to check if screen saver is enabled (if it's then it might be used instead of explicitly checking mouse,keyboard activity). If screen saver kicks in (you might adjust its kickin time programmatically) then timeout is hit. If it's not enabled then you check if there is mouse and KB activity anywhere (in VFP or in another app switched). Between timer firing storing the KB states and checking against previous state map does the job. For mouse it's easier, just storing and checking last position does (you might miss the mouse travelled and returned to the same exact x,y pixels but hardly to reproduce with so many pixels).
When inactivity detected rather than clicking some buttons I'd probably call forms' release, destroy (or click would do if you have some hard to move code).
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform