Skip to content

Latest commit

 

History

History
106 lines (65 loc) · 2.44 KB

wm-ncpaint.md

File metadata and controls

106 lines (65 loc) · 2.44 KB
description ms.assetid title ms.topic ms.date
The WM\_NCPAINT message is sent to a window when its frame must be painted.
d8a2a8b9-2c5d-484c-be09-67eb33de67c0
WM_NCPAINT message (Winuser.h)
reference
05/31/2018

WM_NCPAINT message

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

Requirement Value
Minimum supported client
Windows 2000 Professional [desktop apps only]
Minimum supported server
Windows 2000 Server [desktop apps only]
Header
Winuser.h (include Windows.h)

See also

Painting and Drawing Overview

Painting and Drawing Messages

DefWindowProc

GetWindowDC

WM_PAINT

GetDCEx