Override this member function to perform idle-time processing.
OnIdle is called in the default message loop when the thread's message queue is empty. Use your override to call your own background idle-handler tasks.
OnIdle should return 0 to indicate that no additional idle processing time is required. The lCount parameter is incremented each time OnIdle is called when the message queue is empty and is reset to 0 each time a new message is processed. You can call your different idle routines based on this count.
The default implementation of this member function frees temporary objects and unused dynamic link libraries from memory.
This member function is used only in user-interface threads.
Because the application cannot process messages until OnIdle returns, do not perform lengthy tasks in this function.