Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Force application to close
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00079232
Message ID:
00092777
Views:
35
>Sorry for waiting so long to reply, but I've been busy with my other job that pays the bills. In using this technique you talk about above, where would be the best place to put the timer control, and when would I call the timer event to check for the existence of the changed field or created "dummy file" on the server if I want to close the app when idle over...say 30 minutes? I guess I have another option here and that would be to pick a preset time that is saved in the "dummy table" that the timer event checks for every 30 minutes. If the timer event returns a time greater than the preset time it would then auto close the app, or maybe even prompt the user so they can extend working time for another 30 minutes if they wish. I'll stop rambling now and wait for your expert advise!

Don't wait too long, because I never really needed this feature... :) The main problem I see is how to determine if an user was idle or not for a certain period of time... You have to play a little with the keyboard and mouse events.

For the mouse, this is easy: just store each time the mouse position and compare it with the last one. It's almost impossible to have exactly the same position if the user is using it. It's a little more complicate with the keyboard. A trick would be to:

- Store the LastKey(). If the return value is 255, exit.
- KEYBOARD CHR(255) && Stuff a weird char in the buffer
- INKEY(0) && Read the weird character from the buffer

This will set the LastKey() to 255 and if the user was idle, the next time, etc.

Another problem is "what if the user forgot to save?"...

As for the timer, I would attach it to the app object.

Please let me know if it works...

Vlad
Previous
Reply
Map
View

Click here to load this message in the networking platform