GetClassName

  int GetClassName(hwnd, lpClassName, cchClassName)    
  HWND hwnd; /* handle of window */
  LPTSTR lpClassName; /* address of buffer for class name */
  int cchClassName; /* size of buffer in characters */

This function retrieves the class name of the window specified by the hwnd parameter.

Parameters

hwnd

Identifies the window whose class name is to be retrieved.

lpClassName

Points to the buffer that is to receive the class name.

cchClassName

Specifies the maximum number of characters to be stored in the lpClassName parameter. If the actual name is longer, a truncated name is copied to the buffer.

Return Value

The return value specifies the number of characters actually copied to lpClassName. The return value is zero if the specified class name is not valid.

Comments

The GetClassName 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).

See Also

GetClassInfo, GetClassWord, GetClassLong, FindWindow