Partager via


WM_PARENTNOTIFY message

Sent to the parent of a child window when the child window is created or destroyed, or when the user clicks a mouse button while the cursor is over the child window. 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.

#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) is 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.

     

  • lParam
    The value of lParam depends on the value of the low-order word of wParam. For more information, see the description of wParam.

Return value

If an application processes this message, it should return zero.

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.

Requirements

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Header

Winuser.h (include Windows.h)

See also

Reference

CreateWindow

CreateWindowEx

HIWORD

LOWORD

WM_CREATE

WM_DESTROY

WM_LBUTTONDOWN

WM_MBUTTONDOWN

WM_RBUTTONDOWN

WM_XBUTTONDOWN

Conceptual

Windows

 

 

Send comments about this topic to Microsoft

Build date: 9/11/2011