Click to See Complete Forum and Search --> : Minimising On Idle


June 28th, 1999, 02:40 PM
Hi all,
If there is no user intervention to my application for a configured time, I need to minimise the application. My application does lot of Database updates that may take lot of time. The application should not minimise when it is doing such processing.
Thanks
Steve

June 28th, 1999, 02:53 PM
We do this very thing in our application...

In order to do this, you need to do several things....

You need a DLL that installs hooks to monitor the keyboard and mouse. When your main executable is run, you install the dll and a timer that lets you know how long it has been since your last key press or mouse movement. If you are over your timeout threshhold, you minimize. Do NOT install the timer in the DLL as timer resolution will not work properly in a DLL...pass the current time to the DLL when you load it....

Note that this is NOT an easy thing to do...writing hooking dlls is tricky and you MUST do it correctly or your hook DLL may cause other apps that use hooks to fail and/or behave improperly.