Auto Quit Application after No Activity 
Author Message
 Auto Quit Application after No Activity

I can't seem to get my users to get out of the applications when they're not
using them.  While gone to lunch the leave various data entry/edit forms
open.  I'd really appreciate some help if anyone has some ideas or sample
code on how to auto close the application after no activity for a specified
period.  The procedure should not quit the application if something else is
running such as a query or other procedure.  Thanks,  Mark


Wed, 11 Feb 2004 05:44:10 GMT  
 Auto Quit Application after No Activity

i don't think this is possible without using the windows api and callback
functions.
maybe the startup of a screensaver could be a usefull workaround trigger.

iskander


Quote:
> I can't seem to get my users to get out of the applications when they're
not
> using them.  While gone to lunch the leave various data entry/edit forms
> open.  I'd really appreciate some help if anyone has some ideas or sample
> code on how to auto close the application after no activity for a
specified
> period.  The procedure should not quit the application if something else
is
> running such as a query or other procedure.  Thanks,  Mark



Wed, 11 Feb 2004 22:28:15 GMT  
 Auto Quit Application after No Activity
See http://support.microsoft.com/support/kb/articles/Q210/2/97.ASP

The main problem with this approach is that you can't really tell if some
long-running process is in progress.  I've thought about modifying it so
that long-running processes started by code also increment a global
"long-running process count" and decrement it when done, and have the
idle-time detector also check this count.  That should work for processes
started internally, but not for long-running queries started via the user
interface.

--
Dirk Goldgar
www.datagnostics.com

(to reply via e-mail, remove NOSPAM from address)


Quote:

> i don't think this is possible without using the windows api and callback
> functions.
> maybe the startup of a screensaver could be a usefull workaround trigger.

> iskander



> > I can't seem to get my users to get out of the applications when they're
> not
> > using them.  While gone to lunch the leave various data entry/edit forms
> > open.  I'd really appreciate some help if anyone has some ideas or
sample
> > code on how to auto close the application after no activity for a
> specified
> > period.  The procedure should not quit the application if something else
> is
> > running such as a query or other procedure.  Thanks,  Mark



Thu, 12 Feb 2004 05:35:40 GMT  
 Auto Quit Application after No Activity

Quote:

> The main problem with this approach is that you can't really tell if some
> long-running process is in progress.

That's a good point, but it really boils down to how bad you want it...

Let's look at the possibilities:
(a) Implement a WH_KEYBOARD hook - doable in Access through a hidden form.
Caveat: "No Activity" is defined as "no keyboard activity performed by the
user within this process". Doesn't take care of background processes.

(b) Implement a WH_MOUSE hook - Caveat: Wouldn't recommend it as Access
forms package can be pretty picky at times. (readas: I haven't been able to
get this to work yet.) Doesn't take care of background processes.

(c) Look at each thread under the main Access process to puzzle out which
threads do what, and group thread states by UI and internal threads. Caveat:  
The codebase here will have to branch out for NT, 2000, and Win9x in order
to successfully implement the thread/process walking functions (and can get
{*filter*}).

(d) Implement a home-grown solution by maintaining state flags from each
form's keyboard/mouse procs (possibly through a common Interface, or a
shared hidden form), and derive the "No Activity" flag from those events.
Caveat: most extensive code change.

  -- Dev



Fri, 13 Feb 2004 19:57:44 GMT  
 Auto Quit Application after No Activity
Yikes!

It would be handy if Access maintained some sort of state flag or counter,
accessible to the user, for background processes.

--
Dirk Goldgar
www.datagnostics.com

(to reply via e-mail, remove NOSPAM from address)


Quote:

> > The main problem with this approach is that you can't really tell if
some
> > long-running process is in progress.

> That's a good point, but it really boils down to how bad you want it...

> Let's look at the possibilities:
> (a) Implement a WH_KEYBOARD hook - doable in Access through a hidden form.
> Caveat: "No Activity" is defined as "no keyboard activity performed by the
> user within this process". Doesn't take care of background processes.

> (b) Implement a WH_MOUSE hook - Caveat: Wouldn't recommend it as Access
> forms package can be pretty picky at times. (readas: I haven't been able
to
> get this to work yet.) Doesn't take care of background processes.

> (c) Look at each thread under the main Access process to puzzle out which
> threads do what, and group thread states by UI and internal threads.
Caveat:
> The codebase here will have to branch out for NT, 2000, and Win9x in order
> to successfully implement the thread/process walking functions (and can
get
> {*filter*}).

> (d) Implement a home-grown solution by maintaining state flags from each
> form's keyboard/mouse procs (possibly through a common Interface, or a
> shared hidden form), and derive the "No Activity" flag from those events.
> Caveat: most extensive code change.

>   -- Dev



Sat, 14 Feb 2004 00:05:56 GMT  
 Auto Quit Application after No Activity

Quote:

>Yikes!

>It would be handy if Access maintained some sort of state flag or counter,
>accessible to the user, for background processes.

Yeah, I was thinking Dev was getting a bit more complex than I wanted
to get to.  <smile>

Tony
----
Tony Toews, Microsoft Access MVP
   Please respond only in the newsgroups so that others can
read the entire thread of messages.
   Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm



Sat, 14 Feb 2004 09:54:54 GMT  
 Auto Quit Application after No Activity

Quote:

> Yeah, I was thinking Dev was getting a bit more complex than I wanted
> to get to.

Well, I was just trying to point out that a proper solution for this problem
_is_ too involved for most purposes. It would indeed be simpler if Access
provided us with a state flag (per thread would be nice) so you can
distinguish between what all is going on, but I don't think there's adequate
demand for it (besides which, the UI already handles this internally
anyways).

  -- Dev



Sun, 15 Feb 2004 00:31:57 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Word - Auto Quit

2. Track activity of application??

3. Application Activity

4. Need to cause an application to timeout if no activity

5. Resetting original system colors on quitting application

6. Disable Application Quit ("X") Button

7. Newbie Application.Quit Question

8. Acc97: Application.Quit hangs task

9. Application.Quit statement resets Variables?

10. Access 97 - Application.Quit does not work if msgbox is displayed

11. objWord.Application.Quit crashes Word97

12. Repost -- ACC97: GPF on Application.Quit

 

 
Powered by phpBB® Forum Software