after reading my second reply, you may think that I am also confused with this question, but this time I am sure that I'll give a absolutely right answer as following
firstly, notice this piece of codes in reply 1:
if (m_msgCur.message != WM_KICKIDLE && !PreTranslateMessage(&m_msgCur))
{
::TranslateMessage(&m_msgCur);
:

ispatchMessage(&m_msgCur);
}
return TRUE;
}
it means WM_KICKIDLE never be dispatch to window procedure, that is why your message handler for this message never be called.
secondly, look at the MFC codes for IsIdleMessage(&m_msgCur) which make me confused in reply 2:
BOOL CWinThread::IsIdleMessage(MSG* pMsg)
{
/* Return FALSE if the message just dispatched should _not_ cause OnIdle to be run. Messages which do not usually affect the state of the user interface and happen very often are checked for.*/
// redundant WM_MOUSEMOVE and WM_NCMOUSEMOVE
if (pMsg->message == WM_MOUSEMOVE || pMsg->message == WM_NCMOUSEMOVE)
{
// mouse move at same position as last mouse move?
if (m_ptCursorLast == pMsg->pt && pMsg->message == m_nMsgLast)
return FALSE;
m_ptCursorLast = pMsg->pt; // remember for next time
m_nMsgLast = pMsg->message;
return TRUE;
}
// WM_PAINT and WM_SYSTIMER (caret blink)
return pMsg->message != WM_PAINT && pMsg->message != 0x0118;
}
this piece of code means that a last WM_MOUSEMOVE or WM_NCMOUSEMOVE posted when the cursor is remain at the same place does not cause OnIdle to be called even if it is the last message in the message queue. WM_PAINT and WM_SYSTIMER
has the same effect. All other messages, includding WM_KICKIDLE, can cause OnIdle to be called if there are no messages staying in the message queue after GetMessage gets one of these messages out of message queue.
In conclusion, your application can only reply to WM_KICKIDLE in your overriding of CWinApp::OnIdle.