在MSDN中说明:
NMHDR
Contains information about a notification message. typedef struct tagNMHDR {
HWND hwndFrom;
UINT idFrom;
UINT code;
} NMHDR; Members
hwndFrom
Window handle to the control sending a message.
idFrom
Identifier of the control sending a message.
code
Notification code. This member can be a control-specific notification code or it can be one of the common notification codes.
我的疑问是:
结构体中的第三个成员:code 是指什么呢?什么是通知码?比如当点击按钮的时候,BN_CLICKED就是具体的通知码?
NMHDR
Contains information about a notification message. typedef struct tagNMHDR {
HWND hwndFrom;
UINT idFrom;
UINT code;
} NMHDR; Members
hwndFrom
Window handle to the control sending a message.
idFrom
Identifier of the control sending a message.
code
Notification code. This member can be a control-specific notification code or it can be one of the common notification codes.
我的疑问是:
结构体中的第三个成员:code 是指什么呢?什么是通知码?比如当点击按钮的时候,BN_CLICKED就是具体的通知码?
Notification code. This member can be a control-specific notification code or it can be one of the common notification codes. 已经说得很清楚啦!
NMHDR->code 是消息通知代码,可能每个都不一样,
比如常用的 tooltip 函数:
OnToolTipText(UINT uID, NMHDR* pNMHDR, LRESULT* pResult)
里面就有
if (pNMHDR->code == TTN_NEEDTEXTA)
{
...
}