GetClipboardFormatName

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

At a Glance

Header file: Winuser.h
Windows CE versions: 1.0 and later

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 Values

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 RegisterClipboardFormat function, the system assigns an unsigned integer to the clipboard format.

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

See Also

EnumClipboardFormats, RegisterClipboardFormat