TimeOut

  • Thread starter Thread starter solex
  • Start date Start date
Hi,

I need to implement a TimeOut function in an application. When the
aplication will be idle for one our, for example, i need to clese it.
Someone has any idea about this?

Thanks!

T+

Waldemar
 
You could set a timer which gets reset each time the application does
something, if it ever reaches the defined interval, then exit the
application.

OHM
How about the windows scheduler or AT?

Regards - OHM# OneHandedMan{at}BTInternet{dot}com
 
Please explain to me how this would do what the OP wanted ?

OHM
Herfried,

AT is the command line utility for the windows scheduler.

Dan

Regards - OHM# OneHandedMan{at}BTInternet{dot}com
 
-----Original Message-----
You could set a timer which gets reset each time the application does
something, if it ever reaches the defined interval, then exit the
application.

OHM

Is there an easy way to reset the timer whenever the user
does something in the application? I have previously
placed a line of code in each button, menu item, form,
etc. :p But today my applications are too big to do this
(unless I had decided to inherit everything and put code
in the controls themselves).

I could envision setting up something that looks for any
application activity, but most of my applications do
things on their own even when there is no user there.

It would be great if there were an application level
event called 'OnUserInteraction' where you could put
something like this. Does anything like that exist?

Thank you,
Mark Lauser - Crimson Software
 
Although I havent done it myself, I beleive there is a way to set up a
global event handler. I dont have time to look into this now, but Im sure
one of the other guys has either done it or knows how to do it.

Regards - OHM


Is there an easy way to reset the timer whenever the user
does something in the application? I have previously
placed a line of code in each button, menu item, form,
etc. :p But today my applications are too big to do this
(unless I had decided to inherit everything and put code
in the controls themselves).

I could envision setting up something that looks for any
application activity, but most of my applications do
things on their own even when there is no user there.

It would be great if there were an application level
event called 'OnUserInteraction' where you could put
something like this. Does anything like that exist?

Thank you,
Mark Lauser - Crimson Software

Regards - OHM# OneHandedMan{at}BTInternet{dot}com
 
Without knowing the actual domain problem.

I was thinking that rather then have the application site idle (in memory)
for an hour one could schedule the application to start on the hour every
hour and the application would do it business and then shutdown.
 
Mark,

Sorry I did not really understand your problem when I first read it please
disregard my other comments.

If this is a web app you can set a timeout(timer) when each page loads and
then use OnMouseMove event to reset the timeout.

In a windows-form app you could probably do a similar thing, create a form
that has the keypreview set to TRUE so all key event for the child controls
are registered with the form. On the form load or form activate start the
timer, in the event handler for keypress and mousemove you can reset the
timer. In the form de-activate (if mdi) stop the timer. Then have all of
your form inherit from this base form, if you want you could also do this
with a class.

In both senarios if the timer runs out you can exit your application.

Dan
 
Back
Top