VC中如何得到是谁发出了BN_CLICKED 消息?
当单击按钮时,产生BN_CLICKED消息,但函数无参数,怎样得到如下帮助所说的:WPARAM wParam
LPARAM lParam;我关键是想得到谁发出了这个消息(单击哪个):
BN_CLICKED Notification
--------------------------------------------------------------------------------
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.
Syntax
BN_CLICKED
WPARAM wParam
LPARAM lParam;
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.
Return Value
No return value.
Remarks
A disabled button does not send a BN_CLICKED notification message to its parent window.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1
LPARAM lParam;我关键是想得到谁发出了这个消息(单击哪个):
BN_CLICKED Notification
--------------------------------------------------------------------------------
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.
Syntax
BN_CLICKED
WPARAM wParam
LPARAM lParam;
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.
Return Value
No return value.
Remarks
A disabled button does not send a BN_CLICKED notification message to its parent window.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1
...全文
相关推荐
VC常用控件简介
VC常用控件介绍,方便大家学习和使用VC控件
VC控件及消息映射动态添加和删除
开发项目需要制作,radio控件及消息映射动态添加和删除
深度解析VC中的消息
详细介绍了windows的消息原理机制,及各种消息。
VC2010mfc 按钮按下弹起例子
对话框有两个按钮,可以单独检测到按下弹起事件,通过重载PreTranslateMessage函数实现
VC——消息篇.消息概念在学VC编程的过程中是必定会碰到的,而且是一个很重要的概念。在DOS程序中,我们使用的程序设计方法主要是顺序的,用过TC2/TC3/BC等编程的人对这个会很清楚,我们先定义变量,然后就开始写进行的过程,最后到结束,一切都是井然有序,最多中间来几个条件分支。但是WINDOWS的程序是基于GUI(图形用户界面)的,上面不但有按钮(BUTTON),还有编辑框(EDITBOX),当然还有其它的控件,我们在编程的时候,根本想不到用户会先点哪个,所以WINDOWS的事件驱动的驱动方式
消息概念在学VC编程的过程中是必定会碰到的,而且是一个很重要的概念。在DOS程序中,我们使用的程序设计方法主要是顺序的,用过TC2/TC3/BC等编程的人对这个会很清楚,我们先定义变量,然后就开始写进行的过程,最后到结束,一切都是井然有序,最多中间来几个条件分支。但是WINDOWS的程序是基于GUI(图形用户界面)的,上面不但有按钮(BUTTON),还有编辑框(EDITBOX),当然还有其它的控件,我们在编程的时候,根本想不到用户会先点哪个,所以WINDOWS的事件驱动的驱动方式就显得很重要了,也就是说WINDOWS的程序不由事件的顺序来控制,而是由事件的发生来控制的,所有的事件都是无序的。


