RegisterClass

  ATOM RegisterClass(lpwc)    
  LPWNDCLASS lpwc; /* address of structure with class data */

The RegisterClass function registers a window class for subsequent use in calls to the CreateWindow or CreateWindowEx function.

Parameters

lpwc

Points to a WNDCLASS structure. The structure must be filled with the appropriate class attributes before being passed to the function. The WNDCLASS structure has the following form:

typedef struct tagWNDCLASS { /* wc */

UINT style;

WNDPROC lpfnWndProc;

int cbClsExtra;

int cbWndExtra;

HANDLE hInstance;

HICON hIcon;

HCURSOR hCursor;

HBRUSH hbrBackground;

LPCTSTR lpszMenuName;

LPCTSTR lpszClassName;

} WNDCLASS;

Return Value

The return value is an atom that uniquely identifies the class being registered.

Comments

All window classes registered by an application are unregistered when the application terminates.

See Also

CreateWindow, CreateWindowEx, GetClassInfo, GetClassName, UnregisterClass, WindowProc