Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Inactivity Time out
Message
From
04/06/2002 19:05:57
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
04/06/2002 13:20:38
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00664534
Message ID:
00664772
Views:
21
>>>Hello
>>>
>>>What would be the best time to detect an application timeout ?
>>>
>>>If the user is not active for a period of time I would like to shutdown the application. This is to allow backup at night.
>>>
>>>Any ideas ?
>>>
>>>Xavier
>>
>>Use a Timer object. Reset it every time the user presses a key. When the time elapses, call the code to shut down.
>>
>>Detecting keystrokes requires to intercept Form.KeyPress(), and setting Form.Keypreview = .T.
>>
>>HTH, Hilmar.
>Hi This is nice if you have one form but what if the user only has the menu displayed ?
>
>Xavier

Hmmm... I didn't think about that one. But if the user doesn't open any form for 5 minutes ... Perhaps you could confirm exit with a MessageBox (create your own version, as a form, with a timeout), to avoid surprising the user.

I don't know whether there is a .KeyPress for the _screen object.

Another possibility might be to have the focus on a form, always open, that is off-screen limits (Form.Top = 10000). If no other form is open, this form might be open. But I really don't like this solution myself.

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform