GetClipboardDataAlloc

The GetClipboardDataAlloc function retrieves data from the clipboard in the specified format.

Syntax

HANDLE GetClipboardDataAlloc(UINT uFormat);

At a Glance

Header file: Winuser.h
Component: clipbd
Platforms: H/PC
Windows CE versions: 1.0 and later

Parameters

uFormat
The clipboard format of the data being retreived.

Return Values

If the function succeeds, the return value is the handle to a clipboard object in the specified format. If the function fails, the return value is NULL. To get extended error information, call GetLastError.

Remarks

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

GetClipboardDataAlloc works like the GetClipboardData function 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 LocalFree when no longer in use. GetClipboardDataAlloc should be used if the caller would usually call the GetClipboardData function and then the LocalAlloc function before copying the data.

See Also

GetClipboardData, LocalFree, LocalAlloc