OleDuplicateData function (ole2.h)

Duplicates the data found in the specified handle and returns a handle to the duplicated data. The source data is in a clipboard format. Use this function to help implement some of the data transfer interfaces such as IDataObject.

Syntax

HANDLE OleDuplicateData(
  [in] HANDLE     hSrc,
  [in] CLIPFORMAT cfFormat,
  [in] UINT       uiFlags
);

Parameters

[in] hSrc

Handle of the source data.

[in] cfFormat

Clipboard format of the source data.

[in] uiFlags

Flags to be used to allocate global memory for the copied data. These flags are passed to GlobalAlloc. If the value of uiFlags is NULL, GMEM_MOVEABLE is used as a default flag.

Return value

On success the HANDLE to the source data is returned; on failure a NULL value is returned.

Remarks

The CF_METAFILEPICT, CF_PALETTE, or CF_BITMAP formats receive special handling. They are GDI handles and a new GDI object must be created instead of just copying the bytes. All other formats are duplicated byte-wise.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header ole2.h
Library Ole32.lib
DLL Ole32.dll