Windows Mobile 6.5
A version of this page is also available for

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

HANDLE SetClipboardData(
  UINT uFormat, 


[in] Unsigned integer that specifies a clipboard format. This parameter can be a registered format or any of the standard clipboard formats. Windows Embedded CE supports the following standard clipboard values.

Value Description


Not supported.


A memory object containing a BITMAPINFO structure followed by the bitmap bits.


Software Arts' Data Interchange Format.


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 SelectPalette and RealizePalette functions 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.


Data for the pen extensions to the Microsoft® Windows® for Pen Computing.


Represents audio data more complex than can be represented in a CF_WAVE standard wave format.


Microsoft Symbolic Link (SYLK) format.


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.


Represents audio data in one of the standard wave formats, such as 11 kHz or 22 kHz pulse code modulation (PCM).


Tagged-image file format.


Unicode text format. Each line ends with a carriage return/linefeed (CR-LF) combination. A null character signals the end of the data.


[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_RENDERFORMAT and WM_RENDERALLFORMATS messages.

After SetClipboardData is called, the system owns the object identified by the hMem parameter. The application can read the data, but must not free the handle or leave it locked. If the hMem parameter identifies a memory object, the object must have been allocated using the LocalAlloc function.

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

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

Windows Embedded CE does not perform any implicit conversions between formats.

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

Windows Embedded CE does not provide support for an application to set clipboard data for a window owned by another process.

Windows Embedded CEWindows CE 1.0 and later
Windows MobileWindows Mobile Version 5.0 and later