MFC的消息流动
2015-11-17 22:48
260 查看
MFC的消息流动
本文分析MFC4.0的消息流动,从注册消息处理函数到窗口接受到消息的处理过程;MFC中MessageMap用到的数据类型
struct AFX_MSGMAP { AFX_MSGMAP* pBaseMessageMap; AFX_MSGMAP_ENTRY* lpEntries; }; struct AFX_MSGMAP_ENTRY // MFC 4.0 format { UINT nMessage; // windows message UINT nCode; // control code or WM_NOTIFY code UINT nID; // control ID (or 0 for windows messages) UINT nLastID; // used for entries specifying a range of control id's UINT nSig; // signature type (action) or pointer to message # AFX_PMSG pfn; // routine to call (or special value) };
基于Docment/View的窗口处理函数创建过程
最终只要是基于CWnd的类都将自己的窗口函数注册为AfxWndProc,注册过程如下1.CWnd::CreateEx
2. AfxHookWindowCreate
3. AfxHookWindowCreate
4. _AfxCbtFilterHook
5. _AfxStandardSubclass((HWND)wParam)
6. AfxGetAfxWndProc()
7. AfxWndProc
消息流动如下
相关文章推荐
- Visual C++中MFC消息的分类
- MFC中Radio Button的用法详解
- MFC对话框中添加状态栏的方法
- MFC创建右键弹出菜单的方法
- MFC中动态创建控件以及事件响应实现方法
- C++ 关于MFC多线程编程的注意事项
- MFC程序对文件的处理方法
- MFC自定义消息的实现方法
- MFC实现在文件尾追加数据的方法
- MFC之ComboBox控件用法实例教程
- MFC绘制不规则窗体的方法
- IE8引发 VS2005/2008 MFC向导出错的解决方案
- MFC实现全屏功能代码实例
- 使用VS2010创建MFC ActiveX工程项目
- C++中MFC Tab Control控件的使用详解
- MFC程序设计常用技巧汇总
- MFC扩展DLL中导出类和对话框的实现方法
- VC中SDK与MFC的区别浅析
- 浅谈MFC 改变控件大小和位置
- VC MFC非模态对话框的实现方法