Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Automatically Shut down application if not used
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00800554
Message ID:
00800732
Views:
26
>Hi Kevin
>
>A custom timer object could have three additional properties to hold (1) the last key pressed, (2) the last mouse x position, and (3) the last mouse y position. In the timer init event set the three properties using LASTKEY(), MROW(), and MCOL(). Set the timer interval to 60 minutes (or whatever period is required).
>
>When the timer event fires compare the three properties to their current states. If any of them are different update the properties with the new (current) values and return normally. If the current state is identical then I would assume the system is idle i.e. no keyboard activity and no mouse movement for the timer interval, then quit the application.
>
>Running a timer consumes very little processing power or other resources.

Jos,
Your solution will work great exept sometimes it can take close to 2 hours before the application shuts down. If timer is initialized at time 0 minutes and mose is moved at time 1 minute, when timer fires at time 60 minutes it will regiser change and reset properties. Timer will fire again at itme 120 minutes and register no change and shut down the app. Time elapsed since mouse movement in this example is 119 minutes. If this is aceptabe this is a great solution.

Just my $0.02

Einar
Semper ubi sub ubi.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform