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 data from the clipboard in the specified format.

Syntax

HANDLE GetClipboardDataAlloc(
  UINT 
uFormat
);

Parameters

uFormat

[in] Unsigned integer that specifies the clipboard format of the data being retrieved.

Return Value

The handle to a clipboard object in the specified format indicates success. NULL indicates failure. To get extended error information, call GetLastError.

Remarks

The GetClipboardDataAllocfunction can potentially save an extra memory allocation in cases where the clipboard data is being transferred across processes.

GetClipboardDataAllocworks like the GetClipboardDatafunction except it returns a handle to the memory allocated for the clipboard data in the caller's process. This memory is owned by the calling process and needs to be freed using LocalFreewhen no longer in use. GetClipboardDataAllocshould be used if the caller would usually call the GetClipboardDatafunction and then the LocalAllocfunction before copying the data.

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