Message Reflection for Windows Controls
来源:互联网 发布:淘宝上买ae片头模板 编辑:程序博客网 时间:2024/06/06 17:50
一般子窗口通知父窗口处理的消息,主要有NOTIFY消息,COMMAND消息,以及DRAWITEM,CTLCOLOR消息.让父窗口来处理.
如果你想写一个比较独立的控件的话,你会想把一些CTLCOLOR消息的处理封装在子控件内,不需要调用方做过多的设置.
这样话,MFC提供了一套消息映射到机制,主要是把父窗口的消息映射到子窗口.这样,像CTLCOLOR消息,就可以在子窗口中进行设置.
原理很简单,就是在处理对应消息的时候,多了一次让子窗口处理的过程.
消息映射到宏主要有
ON_CONTROL_REFLECT( wNotifyCode , memberFxn )
afx_msg void memberFxn ( );
ON_NOTIFY_REFLECT( wNotifyCode , memberFxn )
afx_msg void memberFxn ( NMHDR * pNotifyStruct , LRESULT* result );
ON_UPDATE_COMMAND_UI_REFLECT( memberFxn )
afx_msg void memberFxn ( CCmdUI* pCmdUI );
ON_WM_CTLCOLOR_REFLECT( )
afx_msg HBRUSH CtlColor ( CDC* pDC , UINT nCtlColor );
ON_WM_DRAWITEM_REFLECT( )
afx_msg void DrawItem ( LPDRAWITEMSTRUCT lpDrawItemStruct );
ON_WM_MEASUREITEM_REFLECT( )
afx_msg void MeasureItem ( LPMEASUREITEMSTRUCT lpMeasureItemStruct );
ON_WM_DELETEITEM_REFLECT( )
afx_msg void DeleteItem ( LPDELETEITEMSTRUCT lpDeleteItemStruct );
ON_WM_COMPAREITEM_REFLECT( )
afx_msg int CompareItem ( LPCOMPAREITEMSTRUCT lpCompareItemStruct );
ON_WM_CHARTOITEM_REFLECT( )
afx_msg int CharToItem ( UINT nKey , UINT nIndex );
ON_WM_VKEYTOITEM_REFLECT( )
afx_msg int VKeyToItem ( UINT nKey , UINT nIndex );
ON_WM_HSCROLL_REFLECT( )
afx_msg void HScroll ( UINT nSBCode , UINT nPos );
ON_WM_VSCROLL_REFLECT( )
afx_msg void VScroll ( UINT nSBCode , UINT nPos );
ON_WM_PARENTNOTIFY_REFLECT( )
afx_msg void ParentNotify ( UINT message , LPARAM lParam );
- Message Reflection for Windows Controls
- Message Reflection for Windows Controls
- Alpha Controls for Delphi
- Windows Common Controls
- Windows Vista Parental Controls
- Advanced Windows Controls
- Message Map of Controls in CDialog (DoModal)
- For Each ctl In Controls
- Windows Message
- windows message
- windows Message
- Windows Message
- Windows Message
- "Ascend.Net" Windows Forms Controls
- Windows Dev Intro - Subclassing Controls
- mechanisms for reflection in AX
- Controls
- controls
- sybase锁机制以及死锁避免
- java 网络程序 自动定时连接
- java 365*1000*60*60*24 计算问题
- strcpy和memcpy
- linq to sql 学习(5)关于排序的介绍
- Message Reflection for Windows Controls
- 优秀的工作流引擎的特点144个
- 主元分析(PCA)理论分析及应用
- linq to sql 学习(6)linq的分页实例
- 影响时间需求分析
- 关于主线同分支合并的概念及如何使用的误区
- VC++中使用Disassembly查看代码
- Windows XP + Apache 2.2.4 + PHP 5.2 + MySQL 5.0.18 +eclipse3.2+wampp-2.2.zip+HardCore环境配置说明
- SQL2005新手开发常见问题