中国IT动力,最新最全的IT技术教程
最新100篇 | 推荐100篇 | 专题100篇 | 排行榜 | 搜索 | 在线API文档
首 页 | 程序开发 | 操作系统 | 软件应用 | 图形图象 | 网络应用 | 精文荟萃 | 教育认证 | 硬件维护 | 未整理篇 | 站长教程
ASP JS PHP工程 ASP.NET 网站建设 UML J2EESUN .NET VC VB VFP 网络维护 数据库 DB2 SQL2000 Oracle Mysql
服务器 Win2000 Office C DreamWeaver FireWorks Flash PhotoShop 上网宝典 CorelDraw 协议大全 网络安全 微软认证
硬件维护  CPU  主板  硬盘  内存  显卡  显示器  键盘鼠标  声卡音箱  打印机  机箱电源  BIOS  网卡  C#  Java  Delphi  vs.net2005
  当前位置:> 程序开发 > 编程语言 > 综合其它
CWindowImpl类
作者:未知 时间:2005-07-27 23:32 出处:CSDN 责编:chinaitpower
              摘要:CWindowImpl类

这个类允许你创建一个新的窗口或使一个存在的窗口变成一个子类。CWindowImpl窗口程序使用消息映射来导向详细到响应的句柄。
template
< class T,
class TBase = CWindow,
class TWinTrait = CControlWinTraits >
class ATL_NO_VTABLE CWindowImpl :
public CWindowImplBaseT< TBase, TWinTraits >
参数:
T:你的类,继承自CWindowImpl
TBase:你类的基类,默认的类是CWindow
TWinTrait:一个定义你窗口风格的特性类。默认是CControlWinTraits.
备注:
Window CE支持一对新的窗口扩展风格,但其他的WINDOWS平台并不支持。同样Windows CE也不支持许多其他桌面平台上的窗口风格。这意味着你不能使用其他平台相同的标志类作为Create的参数dwStyle和dwExStyle的值。WindowCE也不支持标准的菜单条。
CWindowImpl::Create创建一个新的基于CWndClassInfo管理的窗口类消息的窗口。CWindowImpl包含
DECLARE_WND_CLASS宏,它意味着CWndClassInfo将注册一个新的窗口类。如果你想超类化一个存在的类,从CWindowImpl继承被包含DECLARE_WND_SUPERCLASS宏。这种情况下,CWndClassInfo将注册
一个基于存在的类的窗口类,但使用CWindowImpl::WindowProc作为处理函数。例如:
class CMyWindow : CComControl<CMyWindow>, ...
                // CComControl derives from CWindowImpl
{
public:
   // 1. The NULL parameter means ATL will generate a
   //    name for the superclass.
   // 2. The "EDIT" parameter means the superclass is
   //    based on the standard Windows Edit box.
   DECLARE_WND_SUPERCLASS(NULL, "EDIT")
   ...
};

因为CWndClassInfo 管理一个单个窗口类的信息,每个通过一个CWindowImpl实例创建的窗口都基于相同的窗口类。
CWindowImpl也支持窗口子类化。子类窗口方法附加一个存在的窗口到CWindowImpl对象并改变窗口处理程序为CWindowImpl::WvindowProc。每个CWindowImpl实例能够子类化一个不同的窗口。
对于任何给定的CWindowImpl对象,调用Create或SubclassWindow。你不应该同时调用这两个方法。
另外在CWindowImpl中,ATL提供CWindowImpl来创建一个包含其他对象的窗口。基类的析构函数确保window在对象被销毁之前无效。
CWindowImpl继承自CWindowImplBaseT,CWindowImplBaseT继承自CWindowImplRoot,CWindowImplRoot
继承字TBase和CMessageMap.


关闭本页
 
首页 | 投资与合作 | 服务条款 | 隐私政策 | 收藏本站 | 设为首页 | 新用户注册 | 免责声明 | 使用帮助
Copyright ©2005-2008 chinaitpower.com All rights reserved. www.chinaitpower.com 版权所有