windows_programming_notes.nbk: Home | Index | Next Page: WM_NOTIFYFORMAT | Previous Page: WM_NEXTMENU


 WM_NOTIFY

The WM_NOTIFY message is sent by a common control to its parent window when an event has occurred or the control requires some information.

    WM_NOTIFY 
        idCtrl = (int) wParam; 
        pnmh = (LPNMHDR) lParam; 
    lResult = SendMessage(          // returns LRESULT in lResult     
        (HWND) hWndControl,         // handle to destination control     
        (UINT) WM_NOTIFY,           // message ID     
        (WPARAM) wParam,            // = (WPARAM) (int) idCtrl;    
        (LPARAM) lParam             // = (LPARAM) (LPNMHDR) pnmh; 
    );

Parameters

Return Values

The return value is ignored except for notification messages that specify otherwise.

Remarks

If the message handler is in a dialog box procedure, you must use the SetWindowLong function with DWL_MSGRESULT to set a return value.

The standard Microsoft® Windows® controls (edit controls, combo boxes, list boxes, buttons, scroll bars, and static controls) do not send WM_NOTIFY messages. To determine if a common control will send a WM_NOTIFY message and, if it will, which notification codes it will send, see the documentation for the control.

For Windows 2000 and later systems, the WM_NOTIFY message cannot be sent between processes.

Message Information


Message Handler Prototype

int on_notify(HWND hwnd, int cntrl_id, NMHDR* nmhdr)

windows_programming_notes.nbk: Home | Index | Next Page: WM_NOTIFYFORMAT | Previous Page: WM_NEXTMENU


Notebook exported on Monday, 7 July 2008, 18:56:50 PM Eastern Daylight Time