WM_NOTIFY Message

WM_NOTIFY 是容器器行消息,我们发送消息的时候其实是大消息NOTIFY 中的

一种小的消息而已 NMHDR   Structure

Contains information about a notification message.

Syntax

typedef struct tagNMHDR {
    HWND hwndFrom;
    UINT_PTR idFrom;
    UINT code;
} NMHDR;

Members

hwndFrom
A window handle to the control sending the message.
idFrom
An identifier of the control sending the message.
code
A notification code. This member can be a control-specific notification code or it can be one of the common notification codes.

Structure Information





Sent by a common control to its parent window when an event has occurred or the control requires some information.

Syntax

To send this message, call the SendMessage function as follows.
   
   
   
   
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

idCtrl
The identifier of the common control sending the message. This identifier is not guaranteed to be unique. An application should use the hwndFrom or idFrom member of the NMHDR structure (passed as the lParam parameter) to identify the control.
pnmh
A pointer to an NMHDR structure that contains the notification code and additional information. For some notification messages, this parameter points to a larger structure that has the NMHDR structure as its first member.

Return Value

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.

Many notifications are available in both ANSI and Unicode formats. The window sending the WM_NOTIFY message uses the WM_NOTIFYFORMAT message to determine which format should be used. See WM_NOTIFYFORMAT for further discussion.

你可能感兴趣的:(WM_NOTIFY Message)