Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
CWinThread::IsIdleMessage

CWinThread::IsIdleMessage

Override this function to keep OnIdle from being called after specific messages are generated.

virtual BOOL IsIdleMessage(
   MSG* pMsg 
);

Parameters

pMsg
Points to the current message being processed.

Return Value

Nonzero if OnIdle should be called after processing message; otherwise 0.

Remarks

The default implementation does not call OnIdle after redundant mouse messages and messages generated by blinking carets.

If an application has created a short timer, OnIdle will be called frequently, causing performance problems. To improve such an application's performance, override IsIdleMessage in the application's CWinApp-derived class to check for WM_TIMER messages as follows:

BOOL CMyApp::IsIdleMessage( MSG* pMsg )
{
   if (!CWinApp::IsIdleMessage( pMsg ) || 
       pMsg->message == WM_TIMER) 
      return FALSE;
   else
      return TRUE;
}

Handling WM_TIMER in this fashion will improve performance of applications that use short timers.

See Also

CWinThread Overview | Class Members | Hierarchy Chart

Show:
© 2015 Microsoft