Re: MESSAGE_HANDLER(WM_PAINT, OnPaint) vs MSG_WM_PAINT(OnPaint)
"Igor Tandetnik" <[email protected]>
| Newsgroups | gmane.comp.windows.wtl |
|---|---|
| Message-ID | <[email protected]> |
"cmostler" <[email protected]> wrote in message news:[email protected] > In doing so, I found that if I handle the WM_PAINT message using the > MSG_WM_PAINT macro (and associated handler function), the application > will completely utilize a single CPU, continuously processing > WM_PAINT messages. However, if I use the MESSAGE_HANDLER macro for > the WM_PAINT message, the CPU remains idle, as expected. The difference is not in the macros, but in your handler. I bet when you handle MSG_WM_PAINT you are trying to use HDC passed to you as a parameter (which is actually NULL most of the time), while in your MESSAGE_HANDLER-based hander you call BeginPaint and EndPaint (as you should). -- With best wishes, Igor Tandetnik With sufficient thrust, pigs fly just fine. However, this is not necessarily a good idea. It is hard to be sure where they are going to land, and it could be dangerous sitting under them as they fly overhead. -- RFC 1925 ------------------------------------ Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/wtl/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/wtl/join (Yahoo! ID required) <*> To change settings via email: mailto:[email protected] mailto:[email protected] <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/