
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