文档下载 文档下载导航
设为首页 | 加入收藏
搜索 请输入内容:  
 导航当前位置: 文档下载 > 所有分类 > 工程科技 > 交通运输 > mfc获得各个类的句柄
侵权投诉

mfc获得各个类的句柄

mfc获得各个类的句柄

SDI GetActiveView 得到指针

MDI MDIGetActive() -> GetActiveView() 从 CMainFrame 得到指针,GetActiveView 从 CChildFrame 得到指针

最后提醒大家,在提取到各个句柄之后,因为初次提取的都是标准类句柄,所以,在使用时要注意将标准句柄 转换成自己的类的句柄。

如:

AfxGetApp();//得到的是WinApp类的句柄,

所以操作前记得转换成自己定义的类的句 柄。

如:

((CMyApp*)AfxGetApp())->XXXX();//这的xxxx()就是你定义的类中间的成员。

另 外,附上 MSDN 关于应用程序信息和管理的各个函数:

When you write an application, you create a single CWinApp-derived object. At times, you may want to get information about this object from outside the CWinApp-derived object.

The Microsoft Foundation Class Library provides the following global functions to help you accomplish these tasks:

Application Information and Management Functions

AfxFreeLibrary

Decrements the reference count of the loaded dynamic-link library (DLL) module; when the reference count reaches zero, the module is unmapped.

AfxGetApp

Returns a pointer to the application's single CWinApp object.

AfxGetAppName

Returns a string containing the application's name.

AfxGetInstanceHandle

Returns an HINSTANCE representing this instance of the application.

AfxGetMainWnd

Returns a pointer to the current "main" window of a non-OLE application, or the in-place frame window of a server application.

AfxGetResourceHandle

Returns an HINSTANCE to the source of the application's default resources. Use this to access the application's resources directly.

AfxInitRichEdit

Initializes the version 1.0 rich edit control for the application.

AfxInitRichEdit2

上一页第2页

你可能喜欢

热门文档

相关文档

  • MFC中获得各个类的指针句柄 ID总结

    MFC中获得各个类的指针句柄 ID总结_工作总结/汇报_总结/汇报_应用文书。一般我们使用的框架是 VC 提供的 Wizard 生成的 MFC App Wizard(exe)框架,无论是多...

  • VCMFC编程各种窗口句柄获取函数详解

    VCMFC编程各种窗口句柄获取函数详解_计算机软件及应用_IT/计算机_专业资料。...由类名和窗口标题得句柄,可能不只一个,所以不唯一确定 3、其他参数的句柄 进程...

  • VC MFC编程各种窗口句柄获取函数详解

    VC MFC编程各种窗口句柄获取函数详解_计算机软件及应用_IT/计算机_专业资料 暂无评价0人阅读0次下载举报文档 VC MFC编程各种窗口句柄获取函数详解_计算机软件及...

  • MFC句柄

    句柄百科名片 句柄,是整个 windows 编程的基础,一个句柄是指使用的一个唯一的... mfc获得各个类的句柄 10页 免费 mfc获得各个类的句柄 8页 免费...

  • 如何获取MFC指针、句柄

    如何获取MFC指针、句柄_计算机软件及应用_IT/计算机_专业资料。如何获取MFC指针...平台 SDK GetWindow(hwnd,uCmd)找窗口与之有关系的各个窗口句柄 5.获得实例 ...

  • MFC-句柄和指针

    MFC-句柄和指针_IT/计算机_专业资料。MFC-句柄和指针的介绍VC++中有关句柄...都会有一个其对应的句柄变量,所以我们可以取此对象的 m_hWnd 属性 来得到句柄...

  • MFC中获取各种类指针的方法

    MFC获得各类句柄 4页 免费 MFC各类指针获取 6页 免费MFC中...(2) 15) 从一个视图类取得另一视图类的指针 16)获取分割视图中各个视图的...

  • 句柄的认识

    句柄的认识_文学研究_人文社科_专业资料。句柄...是为了区别系统中存在的各个对象,这个句柄不是由...(hMyHandle); MFC 类中有的还提供了标准方法,比如...

  • MFC获取窗口指针

    获取当前窗口的焦点句柄: mainHwnd = ::GetForegroundWindow();//获取当前 topmost 的窗口 HWND currentFocus = ::GetFocus(); MFC 中获得各个类的句柄的总结 ...

  • MFC如何在文档(CXXXDoc)类或框架(CMainFrame)类中获得...

    多个View,或者有Doc,甚至有多个DocTemplate,可以适当调整 源代码我试过了,应该没什么问题了吧 mfc单文档中如何获取View视图(CmyView类实例产生的窗口)窗口的句柄?...

站点地图 | 文档上传 | 侵权投诉 | 手机版
本站所有资源均来自互联网,本站只负责收集和整理,均不承担任何法律责任,如有侵权等其它行为请联系我们.
文档下载 Copyright 2013 doc.guandang.net All Rights Reserved.  -  email