A class that is derived from a superclass by inheritance. The subclass inherits all features of its superclass, but can add new features or redefine existing ones.
 
Help--->
class:
A template for a type of managed object. WBEM classes define the basic units of management. Each class is a template for a type of managed object, and all instances of the type use the template. For example, the __Win32Provider class is a template for all object providers. superclass:
Or base class. The class from which a subclass inherits. inheritance:
A relationship between two classes in which all the members of the subclass are required to be members of the superclass. Any method or property supported by the superclass must also be supported by any member of the subclass. For example, Modem is a subclass of Logical Device. method:
A function describing the behavior of a class. Including a method in a class does not guarantee an implementation of the method. The Implemented qualifier is attached to the method to indicate that an implementation is available for the class. property:
A name/value pair that describes the data of the class. Property names cannot begin with a digit and cannot contain white space. Property values must have a valid Managed Object Format (MOF) data type. subclass procedure:
An application-defined window procedure that replaces a window's original window procedure when the window is subclassed. See also subclassing, window procedure. subclassing:
A technique that allows an application to intercept and process messages sent or posted to a particular window before the window has a chance to process them. See also subclass procedure. CWnd::SubclassDlgItem :
Call this member function to “dynamically subclass” a control created from a dialog template and attach it to this CWnd object. When a control is dynamically subclassed, windows messages will route through the CWnd’s message map and call message handlers in the CWnd’s class first. Messages that are passed to the base class will be passed to the default message handler in the control.CWnd::PreSubclassWindow :
This member function is called by the framework to allow other necessary subclassing to occur before the window is subclassed. Overriding this member function allows for dynamic subclassing of controls. It is an advanced overridable.CWnd::SubclassDlgItem :
Call this member function to “dynamically subclass” a control created from a dialog template and attach it to this CWnd object. When a control is dynamically subclassed, windows messages will route through the CWnd’s message map and call message handlers in the CWnd’s class first. Messages that are passed to the base class will be passed to the default message handler in the control.CWnd::UnsubclassWindow :
Call this member function to set WndProc back to its original value and detach the window identified by HWND from the CWnd object.CWnd::SubclassWindow :
Call this member function to "dynamically subclass" a window and attach it to this CWnd object. When a window is dynamically subclassed, windows messages will route through the CWnd’s message map and call message handlers in the CWnd’s class first. Messages that are passed to the base class will be passed to the default message handler in the window.

解决方案 »

  1.   

    子类化就是:由超类(superclass)的继承派生出一个类,该类继承了超类的所有功能,并且还能增加功能或重载(override)已有的功能。一般来说,子类化常用于对话框控件,如自定义一个从CEdit派生而来的类CFloatEdit,使对话框中的一些文本输入框支持而且只能输入浮点数,那就必须对那些文本框进入子类化,这样文本框的一切控制和消息处理都可能在CFloatEdit中完成。
      

  2.   

    zhq2000讲的不对,子类化是截获窗口消息的一种方法,通过改变一个已经建立的窗口对象中的窗口过程的地址。
      

  3.   

    同意bhhjf的说,MSDN中说得很清楚,你可以通过SubclassWindow由一个窗口句柄构造你自己的窗口对象,从而接管该窗口的消息处理。SubclassWindow其实是通过SetWindowLong实现的。
      

  4.   

    同意bhhjf的说,MSDN中说得很清楚,你可以通过SubclassWindow由一个已存在的窗口句柄构造你自己的窗口对象,从而接管该窗口的消息处理。SubclassWindow其实就是通过SetWindowLong实现的。
      

  5.   

    也就是说把原来的WndProc替换成你自己的消息处理函数。vb中用得最多。