GetClipboardData Function
HANDLE GetClipboardData(
UINT uFormat
);
Retrieves data from the current entry in the clipboard.
Parameters
-
uFormat
The format of the clipboard data to be retrieved. This parameter can be one of the predefined clipboard format values, or a custom clipboard format value.
For a list of predefined formats, see Clipboard Formats.
Return Value
If the function succeeds, the return value is a handle to the clipboard data object in the specified format. The data is in a format that can be directly accessed by the calling process.
If the function fails, the return value is NULL
. To get extended error information, call GetLastError
.
The handle returned by GetClipboardData
is owned by the clipboard. Do not free or modify this handle. To convert the data to another format, you must create a new entry in the clipboard by calling SetClipboardData
.
Remarks
To open the clipboard for examination, call the OpenClipboard
function. To close the clipboard, call the CloseClipboard
function.
If the specified format is not available on the clipboard, GetClipboardData
returns NULL
.
The system converts the data to the requested format, if possible. If the system cannot convert the data, GetClipboardData
returns NULL
.
The data is available until the clipboard is next opened by another process, or until the contents of the clipboard are reset.
Requirements
Minimum supported client Windows 2000 Professional
Minimum supported server Windows 2000 Server
Header Declared in winuser.h
Library Use User32.lib
DLL User32.dll