Thursday, July 28, 2011

WM_PAINT and WM_ERASEBKGND return values

It's funny that, the return values that represents that the message was processed for the WM_PAINT and WM_ERASEBKGND messages differ. From MSDN:

WM_PAINT:
  • An application returns zero if it processes this message.
  • An application should return nonzero if it erases the background; otherwise, it should return zero.
So when you try to convince Windows not to repaint in any way one window (in which you render with OpenGL for example), you get some WndProc like this:

No comments:

Post a Comment