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 lets you enumerate the data formats that are currently available on the clipboard.

Syntax

UINT EnumClipboardFormats(
  UINT 
format
); 

Parameters

format

[in] Unsigned integer that specifies a clipboard format that is known to be available.

To start an enumeration of clipboard formats, set formatto zero. When formatis zero, the function retrieves the first available clipboard format. For subsequent calls during an enumeration, set formatto the result of the previous EnumClipboardFormatscall.

Return Value

Nonzero indicates success. Zero indicates failure. To get extended error information, call GetLastError. If the clipboard is not open, the function fails.

If there are no more clipboard formats to enumerate, the return value is zero. In this case, the GetLastErrorfunction returns the value NO_ERROR. This lets you distinguish between function failure and the end of enumeration.

Remarks

You must open the clipboard before enumerating its formats. Use the OpenClipboardfunction to open the clipboard. The EnumClipboardFormatsfunction fails if the clipboard is not open.

The EnumClipboardFormatsfunction enumerates formats in the order that they were placed on the clipboard. If you are copying information to the clipboard, add clipboard objects in order from the most descriptive clipboard format to the least descriptive clipboard format. If you are pasting information from the clipboard, retrieve the first clipboard format that you can handle. That will be the most descriptive clipboard format that you can handle.

The system provides automatic type conversions for certain clipboard formats. In the case of such a format, this function enumerates the specified format, then enumerates the formats to which it can be converted.

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