By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,918 Members | 2,228 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,918 IT Pros & Developers. It's quick & easy.

Detect Application

P: n/a
Law
To all the VB master,

i'm new baby in VB. I would like to get ur's advice on how
to stop the application when user is not in use within 5
or 10mins?

Hope to hear VB master soon.

Tks,
Law
Nov 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"Law" <an*******@discussions.microsoft.com> wrote...
i'm new baby in VB. I would like to get ur's advice on how
to stop the application when user is not in use within 5
or 10mins?

Hope to hear VB master soon.


I'm not a VB Master but heck :-) Two questions come to mind, the first is
what is your definition of the term not in use? Do you mean they didn't key
anything in? Would it count as being used if they dragged the window,
clicked on help or made a menu choice? The second is... why are you
concerned?

To answer your question I suspect it would be done through a timer that
measures idle time. You can decide which activities count as "use" having
keypresses or mousemoves (or whatever) restart the idle timer. When the
timer reaches (5 or 10 minutes) it would raise an event and off it goes.
..
Tom
Nov 20 '05 #2

P: n/a
Law
-----Original Message-----
"Law" <an*******@discussions.microsoft.com> wrote...
i'm new baby in VB. I would like to get ur's advice on how to stop the application when user is not in use within 5
or 10mins?

Hope to hear VB master soon.
I'm not a VB Master but heck :-) Two questions come to

mind, the first iswhat is your definition of the term not in use? Do you mean they didn't keyanything in? Would it count as being used if they dragged the window,clicked on help or made a menu choice? The second is... why are youconcerned?

To answer your question I suspect it would be done through a timer thatmeasures idle time. You can decide which activities count as "use" havingkeypresses or mousemoves (or whatever) restart the idle timer. When thetimer reaches (5 or 10 minutes) it would raise an event and off it goes...
Tom
.


Dear Tom,

Tks for your advice. The defination for the term of not in
use which is means that the end user doesn't key-in
anythings or the application idle for long time..
could you provide me with an example on how to count
as "use" in "keypressed" or "mouseover"? or do you know
there can i get an example from internet?

Thanks for your reply.
Law
Nov 20 '05 #3

P: n/a
"Law" <an*******@discussions.microsoft.com> wrote...
Tks for your advice. The defination for the term of not in
use which is means that the end user doesn't key-in
anythings or the application idle for long time..
could you provide me with an example on how to count
as "use" in "keypressed" or "mouseover"? or do you know
there can i get an example from internet?


I'm sure you can find an example of implementing a timer, there are short
tutorials all over. You probably want to make it public so every part of
your application can reference it.

There is (depending upon the type of timer you use) a property like
..Interval in System.Timers.Timer that can be set. 1000 is one second, 60000
would be one minute, etc. and it fires an Elapsed event every time the
counter gets to zero. If you set it for 10 minutes and then reset it every
time some activity takes place it wouldn't get down to zero and the event
wouldn't fire. That event would shut down the app.

You would have to add code to keyboard and mouse events to reset the
..Interval value.

Tom
Nov 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.