Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
THISFORM.Release if idle?
Message
De
09/12/1997 16:25:16
 
 
À
09/12/1997 16:20:49
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00064783
Message ID:
00064797
Vues:
52
>>>I want to close down a form after it has been inactive for a certain period of time. I'm assuming I should use a timer but I'm not sure how to use it properly to capture this situation. Any ideas?
>>
>>*** Timer.Timer event
>>IF ABS(seconds()-thisform.seconds)>1200 && check every 20 min.
>> Release Thisform
>>ENDIF
>>*** ControlX.InteractiveChange event (or something else)
>>Thisform.seconds=seconds()
>
>I have implemented something close o this but used the form.keypress event to reset the seconds proprety. You must, of course set form.keypreview to .T.. keep in mind also, that this method does not detect mouse movements. You could put some code in the form.mousemove event, but this would be too much overhead for my liking.
>
>If I recall, there is an API call that gets the amount of time since the last keyboard _or_ mouse movement. Windows does keep track of this information, it uses it for activating its screensavers. You might want to interrogate someone who has written a screensaver...

Basically, it's about what means 'inactive' form from application standpoint. Remember, that user can switch to another Win app, leaving VFP app on background.
Edward Pikman
Independent Consultant
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform