Has anyone come up with a successful Application "OnIdle" method?

  • Thread starter Thread starter George Aslanis
  • Start date Start date
G

George Aslanis

Hello,

Have several "High Security" apps, which are required to Quit if user
inactivity exceeds some time limit (ex. 10 minutes). I've seen examples,
like Peter's Software, where MouseMove Events are plastered throughout the
app or the older Timer check screen.activecontrol methods. These perform
poorly as compared to using a system hook via SetWindowsHookEx and trapping
all mouse and keyboard movements. VBAccelerator has a great set of routines
in vbalHook6.dll, but while trapping WH_MOUSE, I experienced a terrible
looping of mouse events when using calls to SysCmd(acSysCmdSetStatus,"User
Messages").

Has anyone come up with a successful "OnIdle" method at the application
level? Comments and suggestions welcome.

Thanks,
George
 
Timer check screen.activecontrol methods. These perform
poorly as compared to using a system hook via SetWindowsHookEx and trapping
all mouse and keyboard movements.

Does the screen timer check with active control really work that bad? Have
you tried the following:

a97
http://support.microsoft.com/default.aspx?scid=kb;en-us;128814

a2000
http://support.microsoft.com/default.aspx?scid=kb;en-us;210297

I don't really see why using api's is any better then the above.

I don't think you actually want something that is going to "kill" ms-access
in the task manager. Killing ms-access via the task manager is going to
cause corruptions and damage the data. I would think that you want ms-access
to do the actual (controlled) shutdown of its self in a graceful manor. And,
to be fair, you are NOT suggesting anything other is a nice controlled
shutdown of ms-access anyway.

Regardless, I have used the above method (hidden timer form) for a few
years, and it works very well.

I would give the above code a try.

Was there anything in particular you found about the above hidden time form
that does not work well?
 
George Aslanis said:
Have several "High Security" apps, which are required to Quit if user
inactivity exceeds some time limit (ex. 10 minutes). I've seen examples,
like Peter's Software, where MouseMove Events are plastered throughout the
app or the older Timer check screen.activecontrol methods. These perform
poorly as compared to using a system hook via SetWindowsHookEx and trapping
all mouse and keyboard movements.

My client has been quite happy with the Timer check
screen.activecontrol methods. A few quirks but they're easy to live
with.

HOW TO: Detect User Idle Time or Inactivity in Access 2000 (Q210297)
http://support.microsoft.com/?kbid=210297
ACC: How to Detect User Idle Time or Inactivity (Q128814)
http://support.microsoft.com/?kbid=128814

However we found that the code which runs on the timer event must be
disabled for the programmers. Otherwise weird things start happening
when you're editing code.

Also print preview would sometimes not allow the users to run a menu
item to export the report to Excel or others. So you had to right
click on the Previewed report to get some type of internal focus back
on the report so they could then export it. This was also helped by
extending the timer to five minutes.

The downside to extending the timer to five minutes was if a person
stays in the same form and at the same control for considerable parts
of the day, ie someone doing the same inquiries, the routine didn't
realize that they had actually done something. I'll be putting in
some logic sometime to reset this timer whenever they do something in
the program.

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top