Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
No interaction from user
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00416652
Message ID:
00416676
Vues:
27
>In my application I need to keep track of when the user last interacted with my application. If there has been no interaction for a certain period of time the application will automatically exit itself.
>
>One of the things that comes to mind is that the screen saver starts to run after a certain period of inactivity. So I assume there may be an API(s) I can call which tells me gives me information as to when the last time a user interacted with a particular application... or something on similar lines.
>
>Any help/input/ideas will be appreciated.
>Thanks,
>Ashish

The simple answer is that there is no API involved. It can all be done using generic VFP commands and techniques.

You need to start with an application timer. This will create the running clock when users are not doing anything.

Next you need to keep track of when a user does do something. Windows can do this fairly easily because it is "aware" of everything you do within its environment. The simplest approach is to modify your baseclasses (textboxes, spinners, etc) so that changes to them register to the application as "activity". You can put code in the InterActiveChange to do this.

To register activity, create a custom property of an application object (or create a global variable) that holds the datetime of the last user activity. When the application timer fires, check the last datetime of user activity and if it beyond a certain threshold, exit your application.

This should get you started. There are more involved approaches and you can make it as complex as you want.

HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform