UnregisterClass

  BOOL UnregisterClass(lpszClass, hinst)    
  LPCTSTR lpszClass; /* address of class-name string */
  HANDLE hinst; /* handle of application instance */

The UnregisterClass function removes a window class, freeing the storage required for the class.

Parameters

lpszClass

Points to a null-terminated string or is an atom that identifies a string. If this parameter is an atom, it must be a global atom created by a previous call to the GlobalAddAtom function. The atom, a 16-bit value, must be placed in the low-order word of lpszClass; the high-order word must be zero.

The lpszClass string or atom specifies the window class name. This class name must have been registered by a previous call to the RegisterClass function. Predefined classes, such as dialog-box controls, cannot be unregistered.

hinst

Identifies the instance of the module that created the class.

Return Value

The return value is TRUE if the function successfully removed the window class from the window-class table. It is FALSE if the class could not be found or if a window exists that was created with the class.

Comments

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

The UnregisterClass function may be used as either a wide-character function (where text arguments must use Unicode) or an ANSI function (where text arguments must use characters from the Windows 3.x character set installed).

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

See Also

RegisterClass