UnregisterClass

3.0

  BOOL UnregisterClass(lpszClassName, hinst)    
  LPCSTR lpszClassName; /* address of class-name string */
  HINSTANCE hinst; /* handle of application instance */

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

Parameters

lpszClassName

Points to a null-terminated string containing the class name. This class name must have been registered by a previous call to the RegisterClass function with a valid hinstance member of the WNDCLASS structure. Predefined classes, such as dialog box controls, cannot be unregistered. The WNDCLASS structure has the following form:

typedef struct tagWNDCLASS {    /* wc */
    UINT      style;
    WNDPROC   lpfnWndProc;
    int       cbClsExtra;
    int       cbWndExtra;
    HINSTANCE hInstance;
    HICON     hIcon;
    HCURSOR   hCursor;
    HBRUSH    hbrBackground;
    LPCSTR    lpszMenuName;
    LPCSTR    lpszClassName;
} WNDCLASS;

For a full description of this structure, see the Microsoft Windows Programmer's Reference, Volume 3.

hinst

Identifies the instance of the module that created the class.

Return Value

The return value is nonzero if the function successful. It is zero 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 that were created with the specified class.

See Also

RegisterClass