GetClassInfo

3.0

  BOOL GetClassInfo(hinst, lpszClassName, lpwc)    
  HINSTANCE hinst; /* handle of application instance */
  LPCSTR lpszClassName; /* address of class-name string */
  WNDCLASS FAR* lpwc; /* address of structure for class data */

The GetClassInfo function retrieves information about a window class. This function is used for creating subclasses of a given class.

Parameters

hinst

Identifies the instance of the application that created the class. To retrieve information about classes defined by Windows (such as buttons or list boxes), set this parameter to NULL.

lpszClassName

Points to a null-terminated string containing the class name. The class name is either an application-specified name as defined by the RegisterClass function or the name of a preregistered window class. If the high-order word of this parameter is NULL, the low-order word is assumed to be a value returned by the MAKEINTRESOURCE macro used when the class was created.

lpwc

Points to a WNDCLASS structure that receives the information about the class. 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.

Return Value

The return value is nonzero if the function is successful. Otherwise, it is zero, indicating the function did not find a matching class.

Comments

The GetClassInfo function does not set the lpszClassName and lpszMenuName members of the WNDCLASS structure. The menu name is not stored internally and cannot be returned. The class name is already known, since it is passed to this function. GetClassInfo returns all other members with the values used when the class was registered.

See Also

GetClassLong, GetClassName, GetClassWord, RegisterClass