An application sends the WM_NCPAINT message to a window when its frame must be painted.
WM_NCPAINT
hrgn = (HRGN) wParam; // handle of update region
This value can be passed to GetDCEx as in the following example.
case WM_NCPAINT:
{
HDC hdc;
hdc = GetDCEx(hwnd, (HRGN)wParam, DCX_WINDOW|DCX_INTERSECTRGN);
// Paint into this DC
ReleaseDC(hwnd, hdc);
}
An application returns zero if it processes this message.
The DefWindowProc function paints the window frame.
An application can intercept the WM_NCPAINT message and paint its own custom window frame. The clipping region for a window is always rectangular, even if the shape of the frame is altered.
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in winuser.h.
Painting and Drawing Overview, Painting and Drawing Messages, DefWindowProc, GetWindowDC, WM_PAINT GetDCEx