Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

CWndClassInfo Class

This class provides methods for registering information for a window class.

Important note Important

This class and its members cannot be used in applications that execute in the Windows Runtime.

class CWndClassInfo

Register

Registers the window class.

m_atom

Uniquely identifies the registered window class.

m_bSystemCursor

Specifies whether the cursor resource refers to a system cursor or to a cursor contained in a module resource.

m_lpszCursorID

Specifies the name of the cursor resource.

m_lpszOrigName

Contains the name of an existing window class.

m_szAutoName

Holds an ATL-generated name of the window class.

m_wc

Maintains window class information in a WNDCLASSEX structure.

pWndProc

Points to the window procedure of an existing window class.

CWndClassInfo manages the information of a window class. You typically use CWndClassInfo through one of three macros, DECLARE_WND_CLASS, DECLARE_WND_CLASS_EX, or DECLARE_WND_SUPERCLASS, as described in the following table:

Macro

Description

DECLARE_WND_CLASS

CWndClassInfo registers information for a new window class.

DECLARE_WND_CLASS_EX

CWndClassInfo registers information for a new window class, including the class parameters.

DECLARE_WND_SUPERCLASS

CWndClassInfo registers information for a window class that is based on an existing class but uses a different window procedure. This technique is called superclassing.

By default, CWindowImpl includes the DECLARE_WND_CLASS macro to create a window based on a new window class. DECLARE_WND_CLASS provides default styles and background color for the control. If you want to specify the style and background color yourself, derive your class from CWindowImpl and include the DECLARE_WND_CLASS_EX macro in your class definition.

If you want to create a window based on an existing window class, derive your class from CWindowImpl and include the DECLARE_WND_SUPERCLASS macro in your class definition. For example:

class ATL_NO_VTABLE CMyWindow :
   OtherInheritedClasses
   public 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, _T("EDIT"))

   // Remainder of class declaration omitted

For more information about window classes, see Window Classes in the Windows SDK.

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

Header: atlwin.h

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.