>>>HI everyone!
>>>I would like to include a automatic logout procedure in my application which will execute if the application has been sitting idle for sometime. What would be the best way to program this scenario?\
>>
>>A timer sitting in each form, with the Interactive Change event set to restart the timer for any keystroke or mouse click. If the timer evenr ever fires, nothing has happened in time, and you close down the form...
>>
>>>I will appreciate your help.
>
>
>What if the user has more than one form open at the same time? Couldn't the form that hasn't been used 'in time' fire off the logout procedure when, in fact, the user was just using the other form? Is that how it would work?
>
You could use your form manager class to help here - shut down the form and send a message to the form manager that a timeout occurred. If as a result of timeout, no forms were up and running, then all forms are now closed, the last by timeout, so you can shut down...
You can change the general timeout behavior so that forms don't shutdown from timeouts until all forms have registered a timeout event. That's really the responsibility of the form manager, and not the individual form; the form kows that
it hasn't been active, but the form manager has responsibility for all active forms, at least in theory.
This assumes that you've got a form manager object to work with; if you don't have one, it's something you really need to add to your framework in any case with the possibility of multiple modeless forms operating at the same time.
>- A Hilton