Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
This function prepares the specified window for painting and fills a PAINTSTRUCTstructure with information about the painting.
HDC BeginPaint( HWND hwnd , LPPAINTSTRUCT lpPaint );
Parameters
Return Values
The handle to a display device context for the specified window indicates success. NULL indicates that no display device context is available.
To get extended error information, call GetLastError.
Remarks
The BeginPaintfunction automatically sets the clipping region of the device context to exclude any area outside the update region. The update region is set by the InvalidateRectfunction 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, BeginPaintsends a WM_ERASEBKGNDmessage to the window.
An application should not call BeginPaintexcept in response to a WM_PAINTmessage. Each call to BeginPaintmust have a corresponding call to the EndPaintfunction.
If the caret is in the area to be painted, BeginPaintautomatically hides the caret to prevent it from being erased.
If the window's class has a background brush, BeginPaintuses that brush to erase the background of the update region before returning.
Requirements
Runs on | Versions | Defined in | Include | Link to |
---|---|---|---|---|
Windows CE OS | 1.0 and later | Winuser.h | Coredll.lib, Winmgr.lib |
Note This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.
See Also
EndPaint, GetLastError, InvalidateRect, ValidateRect, WM_ERASEBKGND, WM_PAINT, PAINTSTRUCT