OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
Idle processing

Idle processing lets your application take advantage of the idle time when there are no messages waiting (including user input).

If there are no waiting messages, MessageLoop calls IdleAction.

To perform idle processing, override IdleAction to perform the actual idle processing. Since idle processing takes place while the user isn't doing anything, it should last only a short while. If you need to do anything that takes longer than a few tenths of a second, you should split it into several processes.

IdleAction's parameter idleCount is a long specifying the number of times IdleAction was called between messages. You can use idleCount to choose between low-priority and high-priority idle processing. If idleCount reaches a high value, you know that a long period without user input has passed, so it's safe to perform low-priority idle processing.

Return true from IdleAction to call IdleAction back sooner.

You should always call the base class IdleAction function in addition to performing your own processing. If you are writing applications for Windows NT, you can also use multiple threads for background processing.