AfxRegisterWndClass

Syntax

const char* AfxRegisterWndClass( UINT nClasstyle, HCURSOR hCursor = 0, HBRUSH hbrBackground = 0, HICON hIcon = 0 );

Parameters

nClasstyle

The Windows class style or combination of styles for the window class. This parameter can be any valid window style or control style, or a combination of styles created by using the bitwise-OR (|) operator.

hCursor

A handle to the cursor resource to be installed in each window created from the window class.

hbrBackground

A handle to the brush resource to be installed in each window created from the window class.

hIcon

A handle to the icon resource to be installed in each window created from the window class.

Remarks

Although the Microsoft Foundation Class Library automatically registers several standard window classes for you, you can call this function to register your own window classes. You may also use the function to change the application's icon, although a simpler way is discussed in the Class Libraries User's Guide. For additional information, see Chapter 14, “Window Management.” See that chapter as well for more information about using AfxRegisterWndClass, and see Technical Note 1, in the file TN001.TXT on the distribution disks.

Return Value

A null-terminated string containing the class name. You can pass this class name to the CWnd::Create member function to create a window. The name is generated by the Microsoft Foundation Class Library.

Note:

The return value is stored in a static buffer. To save this string, assign it to a CString variable.