BOOL AfxInternalIsIdleMessage(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? _AFX_THREAD_STATE *pState = AfxGetThreadState(); if (pState->m_ptCursorLast == pMsg->pt && pMsg->message == pState->m_nMsgLast) return FALSE; pState->m_ptCursorLast = pMsg->pt; // remember for next time pState->m_nMsgLast = pMsg->message; return TRUE; } // WM_PAINT and WM_SYSTIMER (caret blink) return pMsg->message != WM_PAINT && pMsg->message != 0x0118; }WM_SYSTIMER是为了光标闪烁,ID为0x118,当然消息为WM_SYSTIMER时OnIdle就不会执行。 不过不应该影响WM_TIMER才对。
RichEdit,我建议你不要仔细去分析,分析那样一个黑盒子得不偿失的。如果RichEdit不能满足你的要求,你最好去CodeProject之类的地方,另外找一个有源代码的合适的Edit。
{
// 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?
_AFX_THREAD_STATE *pState = AfxGetThreadState();
if (pState->m_ptCursorLast == pMsg->pt && pMsg->message == pState->m_nMsgLast)
return FALSE; pState->m_ptCursorLast = pMsg->pt; // remember for next time
pState->m_nMsgLast = pMsg->message;
return TRUE;
} // WM_PAINT and WM_SYSTIMER (caret blink)
return pMsg->message != WM_PAINT && pMsg->message != 0x0118;
}WM_SYSTIMER是为了光标闪烁,ID为0x118,当然消息为WM_SYSTIMER时OnIdle就不会执行。
不过不应该影响WM_TIMER才对。
深入剖析MFC中对于Windows消息处理、运行机制http://search.csdn.net/Expert/topic/674/674432.xml?temp=.6512873
也就是说,如果消息为WM_SYSTIMER或者WM_SYSKEYDOWN,并且空闲显示标志为真的话,就显示窗口并通知窗口立刻重绘。
}
if (!CWinApp::IsIdleMessage( pMsg) || pMsg->message == WM_TIMER) return FALSE;
else return TRUE;
}现象好了很多,基本消失(虽然Progressbar还不是很光滑,但是可以接受了)
请问是什么道理呢?有没有人帮我说明一下。谢谢