Message Map Macros (MFC)

To support message maps, MFC supplies the following macros:为支持消息映射,MFC提供了如下的宏:

Message-Map Declaration and Demarcation Macros(这句就不翻译了。)

DECLARE_MESSAGE_MAP

Declares that a message map will be used in a class to map messages to functions (must be used in the class declaration).

声明消息映射会在一个类中使用,把消息映射到函数上(必须在类声明中使用)。

BEGIN_MESSAGE_MAP

Begins the definition of a message map (must be used in the class implementation).开始消息映射的定义(必须在类实现中使用)。

END_MESSAGE_MAP

Ends the definition of a message map (must be used in the class implementation).结束消息映射的定义(必须在类的实现中使用)。

Message-Mapping Macros 消息映射宏

ON_COMMAND

Indicates which function will handle a specified command message.表示函数会处理指定的命令消息。

ON_CONTROL

Indicates which function will handle a specified control-notification message.表示函数会处理指定的控件通知消息。

ON_MESSAGE

Indicates which function will handle a user-defined message.表示函数会处理用户自定义的消息

ON_OLECMD

Indicates which function will handle a menu command from a DocObject or its container.表示函数会处理来自文档对象或者它的容器的菜单命令

ON_REGISTERED_MESSAGE

Indicates which function will handle a registered user-defined message.表示似函数会处理注册的用户自定义消息。

ON_REGISTERED_THREAD_MESSAGE

Indicates which function will handle a registered user-defined message when you have aCWinThread class.表示函数会处理CWinThread中的注册的用户自定义消息

ON_THREAD_MESSAGE

Indicates which function will handle a user-defined message when you have a CWinThread class.表示线程函数会处理CWinThread中的用户自定义消息。

ON_UPDATE_COMMAND_UI

Indicates which function will handle a specified user-interface update command message.表示函数会处理指定的用户界面更新命令消息。

Message-Map Range Macros

ON_COMMAND_RANGE

Indicates which function will handle the range of command IDs specified in the first two parameters to the macro.表示函数会处理由宏中前两个参数指定的范围所表示的命令ID

ON_UPDATE_COMMAND_UI_RANGE

Indicates which update handler will handle the range of command IDs specified in the first two parameters to the macro.表示更新处理函数会处理由宏中前两个参数指定的范围所表示的命令ID。

ON_CONTROL_RANGE

Indicates which function will handle notifications from the range of control IDs specified in the second and third parameters to the macro. The first parameter is a control-notification message, such asBN_CLICKED.表示函数会处理由宏的第三第四参数指定的控件ID所表示的范围的通知。第一个参数表示控件通知消息,例如BN_CLICKED。

For more information on message maps, the message-map declaration and demarcation macros, and the message-mapping macros, seeMessage Maps andMessage Handling and Mapping Topics. For more information about message-map ranges, seeHandlers for Message-Map Ranges.(更多的信息,参见……)


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值