CDC* BeginPaint( LPPAINTSTRUCT lpPaint );
lpPaint
Points to the PAINTSTRUCT structure that is to receive painting information.
Prepares CWnd for painting and fills a PAINTSTRUCT data structure with information about the painting.
The paint structure contains a RECT data structure that has the smallest rectangle that completely encloses the update region, and a flag that specifies whether the background has been erased.
The update region is set by the Invalidate, InvalidateRect, or InvalidateRgn member functions and by the system after sizing, moving, creating, scrolling, or any other operation that affects the client area. If the update region is marked for erasing, BeginPaint sends an WM_ONERASEBKGND message.
Do not call the BeginPaint member function except in response to a WM_PAINT message. Each call to the BeginPaint member function must have a matching call to the EndPaint member function. If the caret is in the area to be painted, the BeginPaint member function automatically hides the caret to prevent it from being erased.
Identifies the device context for CWnd. The pointer may be temporary, and should not be stored beyond the scope of EndPaint.
CWnd::EndPaint, CWnd::Invalidate, CWnd::InvalidateRgn, ::BeginPaint, CPaintDC