As you know, OnIdle can be specified in MFC UI thread. For details, you can read this reference http://msdn.microsoft.com/en-us/library/1sa2f19f.aspx. But I am not sure how it can be used in practice.
According to the reference above,
"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."
So I can understand that when the UI thread is not busy, the method is called. According to the documentation above,
"Because the application cannot process messages until OnIdle returns, do not perform lengthy tasks in this function."
But what tasks can be done in the idle event? A single example would suffice. Thanks
UPDATE: One discouraging fact is that this old (1996) article by Russell Weisz, titled "First Aid for the Thread-Impaired: Using Multiple Threads with MFC." was very helpful to understand CWinThread.
UPDATE2: As Microsoft removed the MSJ article, this one might be helpful.