WM_NCPAINT message
Applies to: desktop apps only
The WM_NCPAINT message is sent to a window when its frame must be painted.
A window receives this message through its WindowProc function.
LRESULT CALLBACK WindowProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
Parameters
- wParam
-
A handle to the update region of the window. The update region is clipped to the window frame.
- lParam
-
This parameter is not used.
Return value
An application returns zero if it processes this message.
Remarks
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.
The wParam 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);
}
Requirements
|
Minimum supported client | Windows 2000 Professional |
|---|---|
|
Minimum supported server | Windows 2000 Server |
|
Header |
|
See also
- Painting and Drawing Overview
- Painting and Drawing Messages
- DefWindowProc
- GetWindowDC
- WM_PAINT
- GetDCEx
Send comments about this topic to Microsoft
Build date: 3/7/2012
- 8/16/2010
- janecz
- 4/20/2010
- dmitry_ni
case WM_NCPAINT:
{
HDC hdc;
hdc = GetDCEx(hwnd, (HRGN)wParam, DCX_WINDOW | DCX_INTERSECTRGN | 0x10000);
// Paint into this DC
ReleaseDC(hwnd, hdc);
}
(Verified on Windows XP)
- 2/8/2009
- Mityador