Platform SDK: Interprocess Communications

GetClipboardFormatName

The GetClipboardFormatName function retrieves from the clipboard the name of the specified registered format. The function copies the name to the specified buffer.

int GetClipboardFormatName(
  UINT format,            // clipboard format to retrieve
  LPTSTR lpszFormatName,  // format name
  int cchMaxCount         // length of format name buffer
);

Parameters

format
[in] Specifies the type of format to be retrieved. This parameter must not specify any of the predefined clipboard formats.
lpszFormatName
[out] Pointer to the buffer that is to receive the format name.
cchMaxCount
[in] Specifies the maximum length, in TCHARs, of the string to be copied to the buffer. If the name exceeds this limit, it is truncated.

Return Values

If the function succeeds, the return value is the length, in TCHARs, of the string copied to the buffer.

If the function fails, the return value is zero, indicating that the requested format does not exist or is predefined. To get extended error information, call GetLastError.

Requirements

  Windows NT/2000: Requires Windows NT 3.1 or later.
  Windows 95/98: Requires Windows 95 or later.
  Header: Declared in Winuser.h; include Windows.h.
  Library: Use User32.lib.
  Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000.

See Also

Clipboard Overview, Clipboard Functions, EnumClipboardFormats, RegisterClipboardFormat