Microsoft Windows CE 3.0  

SetClipboardData

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.

This function places data on the clipboard in a specified clipboard format.

HANDLE
SetClipboardData(
UINT
uFormat
,
HANDLE
hMem
);

Parameters

uFormat
[in] Unsigned integer that specifies a clipboard format. This parameter can be a registered format or any of the standard clipboard formats. Windows CE supports the following standard clipboard:
Value Description
CF_BITMAP A handle to a bitmap ( HBITMAP).
CF_DIB A memory object containing a BITMAPINFOstructure followed by the bitmap bits.
CF_DIF Software Arts' Data Interchange Format.
CF_PALETTE Handle of a color palette. Whenever an application places data in the clipboard that depends on or assumes a color palette, it should place the palette on the clipboard as well.

If the clipboard contains data in the CF_PALETTE (logical color palette) format, the application should use the SelectPaletteand RealizePalettefunctions to realize (compare) any other data in the clipboard against that logical palette.

When displaying clipboard data, the clipboard always uses as its current palette any object on the clipboard that is in the CF_PALETTE format.

CF_PENDATA Data for the pen extensions to the Microsoft Windows for Pen Computing.
CF_RIFF Represents audio data more complex than can be represented in a CF_WAVE standard wave format.
CF_SYLK Microsoft Symbolic Link (SYLK) format.
CF_TEXT Text format. Each line ends with a carriage return/linefeed (CR-LF) combination. A null character signals the end of the data. Use this format for ANSI text.
CF_WAVE Represents audio data in one of the standard wave formats, such as 11 kHz or 22 kHz pulse code modulation (PCM).
CF_TIFF Tagged-image file format.
CF_UNICODETEXT Unicode text format. Each line ends with a carriage return/linefeed (CR-LF) combination. A null character signals the end of the data.
hMem
[in] Handle to the data in the specified format. This parameter can be NULL, indicating that the window provides data in the specified clipboard format (renders the format) upon request. If a window delays rendering, it must process the WM_RENDERFORMATand WM_RENDERALLFORMATSmessages.

After SetClipboardDatais called, the system owns the object identified by the hMemparameter. The application can read the data, but must not free the handle or leave it locked. If the hMemparameter identifies a memory object, the object must have been allocated using the LocalAllocfunction.

Return Values

The handle of the data indicates success. NULL indicates failure. To get extended error information, call GetLastError.

Remarks

The data to be set into the clipboard should be allocated using the LocalAllocfunction.

Windows CE does not perform any implicit conversions between formats.

The window must be the current clipboard owner, and the application must have called the OpenClipboardfunction.

The system performs implicit data format conversions between certain clipboard formats when an application calls the GetClipboardDatafunction. For example, if the CF_OEMTEXT format is on the clipboard, a window can retrieve data in the CF_TEXT format. The format on the clipboard is converted to the requested format on demand.

Requirements

Runs On Versions Defined in Include Link to
Windows CE OS 1.0 and later Winuser.h   Clipbd.lib
Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

BITMAPINFO, GetClipboardData, OpenClipboard, RegisterClipboardFormat, WM_RENDERFORMAT, WM_RENDERALLFORMATS