UnregisterClassA function

Unregisters a window class, freeing the memory required for the class.

Syntax

BOOL UnregisterClassA(
  LPCSTR    lpClassName,
  HINSTANCE hInstance
);

Parameters

lpClassName

Type: LPCTSTR

A null-terminated string or a class atom. If lpClassName is a string, it specifies the window class name. This class name must have been registered by a previous call to the RegisterClass or RegisterClassEx function. System classes, such as dialog box controls, cannot be unregistered. If this parameter is an atom, it must be a class atom created by a previous call to the RegisterClass or RegisterClassEx function. The atom must be in the low-order word of lpClassName; the high-order word must be zero.

hInstance

Type: HINSTANCE

A handle to the instance of the module that created the class.

Return Value

Type: Type: BOOL

If the function succeeds, the return value is nonzero.

If the class could not be found or if a window still exists that was created with the class, the return value is zero. To get extended error information, call GetLastError.

Remarks

Before calling this function, an application must destroy all windows created with the specified class.

All window classes that an application registers are unregistered when it terminates.

Class atoms are special atoms returned only by RegisterClass and RegisterClassEx.

No window classes registered by a DLL are unregistered when the .dll is unloaded.

Requirements

   
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header winuser.h (include Windows.h)
Library User32.lib
DLL User32.dll

See Also

Conceptual

Reference

RegisterClass

RegisterClassEx

Window Classes