ValidateRect vs BeginPaint

Posted by Armentage on Stack Overflow See other posts from Stack Overflow or by Armentage
Published on 2012-08-27T21:33:23Z Indexed on 2012/08/27 21:38 UTC
Read the original article Hit count: 152

Filed under:

From the MSDN documentation:

The BeginPaint function validates the entire client area.

The ValidateRect function should not be called if a portion of the update region must be validated before the next WM_PAINT message is generated.1

I've been programming with Win32 API for years, and I've never thought to call the ValidateRect function. A co-worker of mine today pointed that we were missing a call to ValidateRect, which fixed a bug we were having doing some high-speed animation using GDI (I know, an oxymoron)

Can someone tell me whether or not a call to ValidateRect is neccessary after a BeginPaint/EndPaint pair? I have seen no documentation at MSDN that sheds light on this, and what documentation and examples I do see that you do not need to.

© Stack Overflow or respective owner

Related posts about winapi