admin管理员组文章数量:1516870
ON
摘自:(v=VS.100).aspx
ON_NOTIFY: Handling WM_NOTIFY Messages in MFC Applications
The function CWnd::OnNotify handles notification messages. Its default implementation checks the message map for notification handlers to call. In general, you do not override OnNotify. Instead, you provide a handler function and add a message-map entry for that handler to the message map of your owner window's class.
ClassWizard, via the ClassWizard property sheet, can create the ON_NOTIFY message-map entry and provide you with a skeleton handler function. For more information on using ClassWizard to make this easier, see Mapping Messages to Functions.
The ON_NOTIFY message-map macro has the following syntax:
where the italicized parameters are replaced with:
Your member function must be declared with the following prototype:
备注
where the italicized parameters are:
示例To specify that you want the member function OnKeydownList1 to handle LVN_KEYDOWN messages from the CListCtrl whose ID is IDC_LIST1, you would use ClassWizard to add the following to your message map:
复制In the example above, the function provided by ClassWizard is:
Note that ClassWizard provides a pointer of the proper type automatically. You can access the notification structure through either pNMHDR or pLVKeyDow.
本文标签: on
版权声明:本文标题:ON 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.betaflare.com/web/1686852687a42082.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论