共用方式為


DECLARE_WND_SUPERCLASS

Allows you to specify the parameters of a class. Place this macro in an ATL ActiveX control's control class.

DECLARE_WND_SUPERCLASS( 
   WndClassName, 
   OrigWndClassName  
)

Parameters

  • WndClassName
    [in] The name of the window class that will superclass OrigWndClassName. If NULL, ATL will generate a window class name.

  • OrigWndClassName
    [in] The name of an existing window class.

Remarks

This macro allows you to specify the name of a window class that will superclass an existing window class. CWndClassInfo manages the information of the superclass.

DECLARE_WND_SUPERCLASS implements the following static function:

static CWndClassInfo& GetWndClassInfo();

By default, CWindowImpl uses the DECLARE_WND_CLASS macro to create a window based on a new window class. By specifying the DECLARE_WND_SUPERCLASS macro in a CWindowImpl-derived class, the window class will be based on an existing class but will use your window procedure. This technique is called superclassing.

Besides using the DECLARE_WND_CLASS and DECLARE_WND_SUPERCLASS macros, you can override the GetWndClassInfo function with your own implementation.

For more information about using windows in ATL, see the article ATL Window Classes.

Requirements

Header: atlwin.h

See Also

Other Resources

Window Class Macros

ATL Macros