BeginPaint
The BeginPaint
function prepares the specified window for painting and fills a PAINTSTRUCT
HDC BeginPaint(
HWND hwnd, |
// handle to window |
LPPAINTSTRUCT lpPaint |
// pointer to
structure for paint information |
); |
|
Parameters
hwnd
Identifies
the window to be repainted.
lpPaint
Pointer to
the PAINTSTRUCT
Return Values
If the
function succeeds, the return value is the handle to a display device context
for the specified window.
If the
function fails, the return value is NULL, indicating that no display device
context is available.
Remarks
The BeginPaint
function automatically sets the clipping region of the device context to
exclude any area outside the update region. The update region is set by the InvalidateRect
An
application should not call BeginPaint except in response to a WM_PAINT
message. Each call to BeginPaint must have a corresponding call to the EndPaint
function.
If the caret
is in the area to be painted, BeginPaint automatically hides the caret
to prevent it from being erased.
If the
window s class has a background brush, BeginPaint uses that brush to
erase the background of the update region before returning.
See Also