WM_PARENTNOTIFY message

Sent to a window when a significant action occurs on a descendant window. This message is now extended to include the WM_POINTERDOWN event. When the child window is being created, the system sends WM_PARENTNOTIFY just before the CreateWindow or CreateWindowEx function that creates the window returns. When the child window is being destroyed, the system sends the message before any processing to destroy the window takes place.

A window receives this message through its WindowProc function.

![Important]
Desktop apps should be DPI aware. If your app is not DPI aware, screen coordinates contained in pointer messages and related structures might appear inaccurate due to DPI virtualization. DPI virtualization provides automatic scaling support to applications that are not DPI aware and is active by default (users can turn it off). For more information, see Writing High-DPI Win32 Applications.

#define WM_PARENTNOTIFY             0x0210

Parameters

wParam

The low-order word of wParam specifies the event for which the parent is being notified. The value of the high-order word depends on the value of the low-order word. This parameter can be one of the following values.

LOWORD(wParam) Meaning
WM_CREATE
0x0001
The child window is being created.
HIWORD(wParam) is the identifier of the child window.
lParam is a handle to the child window.
WM_DESTROY
0x0002
The child window is being destroyed.
HIWORD(wParam) is the identifier of the child window.
lParam is a handle to the child window.
WM_LBUTTONDOWN
0x0201
The user has placed the cursor over the child window and has clicked the left mouse button.
HIWORD(wParam) is undefined.
lParam is the x-coordinate of the cursor is the low-order word, and the y-coordinate of the cursor is the high-order word.
WM_MBUTTONDOWN
0x0207
The user has placed the cursor over the child window and has clicked the middle mouse button.
HIWORD(wParam) is undefined.
lParam is the x-coordinate of the cursor is the low-order word, and the y-coordinate of the cursor is the high-order word.
WM_RBUTTONDOWN
0x0204
The user has placed the cursor over the child window and has clicked the right mouse button.
HIWORD(wParam) is undefined.
lParam is the x-coordinate of the cursor is the low-order word, and the y-coordinate of the cursor is the high-order word.
WM_XBUTTONDOWN
0x020B
The user has placed the cursor over the child window and has clicked the first or second X button.
HIWORD(wParam) indicates which button was pressed. This parameter can be one of the following values: XBUTTON1 or XBUTTON2.
lParam is the x-coordinate of the cursor is the low-order word, and the y-coordinate of the cursor is the high-order word.
WM_POINTERDOWN
0x0246
A pointer has made contact with the child window.
HIWORD(wParam) contains the identifier of the pointer that generated the WM_POINTERDOWN event.

lParam

Contains the point location of the pointer.

Note

Because the pointer may make contact with the device over a non-trivial area, this point location may be a simplification of a more complex pointer area. Whenever possible, an application should use the complete pointer area information instead of the point location.

Use the following macros to retrieve the physical screen coordinates of the point.

Return value

If the application processes this message, it returns zero.

If the application does not process this message, it calls DefWindowProc.

Remarks

This message is also sent to all ancestor windows of the child window, including the top-level window.

All child windows, except those that have the WS_EX_NOPARENTNOTIFY extended window style, send this message to their parent windows. By default, child windows in a dialog box have the WS_EX_NOPARENTNOTIFY style, unless the CreateWindowEx function is called to create the child window without this style.

This notification provides the child window's ancestor windows an opportunity to examine the pointer information and, if required, capture the pointer using the pointer capture functions.

Requirements

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

See also

Messages

CreateWindow

CreateWindowEx

HIWORD

LOWORD

WM_CREATE

WM_DESTROY

WM_LBUTTONDOWN

WM_MBUTTONDOWN

WM_RBUTTONDOWN

WM_XBUTTONDOWN