Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

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

Syntax

int GetClipboardFormatName(
  UINT 
format, 
  LPTSTR 
lpszFormatName, 
  int 
cchMaxCount
); 

Parameters

format

[in] Unsigned integer that specifies the type of format to be retrieved. This parameter must not specify any of the predefined clipboard formats.

lpszFormatName

[out] Long pointer to the buffer that is to receive the format name.

cchMaxCount

[in] Unsigned integer that specifies the maximum length, in characters, of the string to be copied to the buffer. If the name exceeds this limit, it is truncated.

Return Value

The length, in characters, of the string copied to the buffer indicates success. Zero indicates that the requested format does not exist or is predefined, and that the function failed. To get extended error information, call GetLastError.

Remarks

When an application registers a clipboard format name with a call to the RegisterClipboardFormatfunction, the system assigns an unsigned integer to the clipboard format.

To obtain the available clipboard formats for clipboard data, an application calls the EnumClipboardFormatsfunction. This function enumerates the clipboard formats using their associated integers. An application calls GetClipboardFormatNameto retrieve the name of a registered clipboard format and display it to a user.

Requirements

Header winuser.h
Library Clipbd.lib
Windows Embedded CE Windows CE 1.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also