다음을 통해 공유


DECLARE_WND_CLASS

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

DECLARE_WND_CLASS( 
   WndClassName  
)

Parameters

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

Remarks

This macro allows you to specify the name of a new window class whose information will be managed by CWndClassInfo. DECLARE_WND_CLASS defines the new window class by implementing the following static function:

static CWndClassInfo& GetWndClassInfo();

DECLARE_WND_CLASS specifies the following styles for the new window:

  • CS_HREDRAW

  • CS_VREDRAW

  • CS_DBLCLKS

DECLARE_WND_CLASS also specifies the default window's background color. Use the DECLARE_WND_CLASS_EX macro to provide your own styles and background color.

CWindowImpl uses the DECLARE_WND_CLASS macro to create a window based on a new window class. To override this behavior, use the DECLARE_WND_SUPERCLASS macro, or provide your own implementation of the GetWndClassInfo function.

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