BN_CLICKED =========== 按钮的通知消息:具体看MSDN: BN_CLICKED The BN_CLICKED notification code is sent when the user clicks a button. The parent window of the button receives the BN_CLICKED notification code through the WM_COMMAND message. LRESULT CALLBACK WindowProc( HWND hwnd, // handle to window UINT uMsg, // WM_COMMAND WPARAM wParam, // identifier of button, BN_CLICKED LPARAM lParam // handle to button (HWND) ); Parameters wParam The low-order word contains the button's control identifier. The high-order word specifies the notification message. lParam Handle to the button.
1、命令消息(WM_COMMAND)
所有派生自 CCmdTarget 的类都有资格接受WM_COMMAND。 2、Window消息(WM_xxx)
所有派生自 CWnd 的类都有资格接受 WM_xxx。 3、控件消息(WM_NOTIFY)
控件向其父窗口通知消息。 按钮按下消息应该属于控件消息消息吧
在Messages: 下面有个啊 button_clicked 这个是什么东西
===========
按钮的通知消息:具体看MSDN:
BN_CLICKED
The BN_CLICKED notification code is sent when the user clicks a button. The parent window of the button receives the BN_CLICKED notification code through the WM_COMMAND message. LRESULT CALLBACK WindowProc(
HWND hwnd, // handle to window
UINT uMsg, // WM_COMMAND
WPARAM wParam, // identifier of button, BN_CLICKED
LPARAM lParam // handle to button (HWND)
);
Parameters
wParam
The low-order word contains the button's control identifier.
The high-order word specifies the notification message. lParam
Handle to the button.
==================================
不同的,这个并不是真正的消息,我们知道控件和父窗体通讯一般都是控件向父窗体发送WM_COMMAND,但是控件在通知父窗体时,因为用户行为的不同,通知的内容也不同,消息都是WM_COMMAND,而在wParam这个参数中说明用户的行为,比如你单击按钮,这个参数就是BN_CLICKED,如果你双击按钮,这个参数就是BN_DBLCLK了。