## Clipboard functions

These clipboard functions are implemented for Windows only. The use of these functions is deprecated and the code is no longer maintained. Use the wxClipboard class instead.

Include files

<wx/clipbrd.h>

::wxClipboardOpen
::wxCloseClipboard
::wxEmptyClipboard
::wxEnumClipboardFormats
::wxGetClipboardData
::wxGetClipboardFormatName
::wxIsClipboardFormatAvailable
::wxOpenClipboard
::wxRegisterClipboardFormat
::wxSetClipboardData

### ::wxClipboardOpen

bool wxClipboardOpen()

Returns TRUE if this application has already opened the clipboard.

### ::wxCloseClipboard

bool wxCloseClipboard()

Closes the clipboard to allow other applications to use it.

### ::wxEmptyClipboard

bool wxEmptyClipboard()

Empties the clipboard.

### ::wxEnumClipboardFormats

int wxEnumClipboardFormats(int dataFormat)

Enumerates the formats found in a list of available formats that belong to the clipboard. Each call to this function specifies a known available format; the function returns the format that appears next in the list.

dataFormat specifies a known format. If this parameter is zero, the function returns the first format in the list.

The return value specifies the next known clipboard data format if the function is successful. It is zero if the dataFormat parameter specifies the last format in the list of available formats, or if the clipboard is not open.

Before it enumerates the formats function, an application must open the clipboard by using the wxOpenClipboard function.

### ::wxGetClipboardData

wxObject * wxGetClipboardData(int dataFormat)

Gets data from the clipboard.

dataFormat may be one of:

- wxCF_TEXT or wxCF_OEMTEXT: returns a pointer to new memory containing a null-terminated text string.
- wxCF_BITMAP: returns a new wxBitmap.

The clipboard must have previously been opened for this call to succeed.

### ::wxGetClipboardFormatName

bool wxGetClipboardFormatName(int dataFormat, const wxString& formatName, int maxCount)

Gets the name of a registered clipboard format, and puts it into the buffer formatName which is of maximum length maxCount. dataFormat must not specify a predefined clipboard format.

### ::wxIsClipboardFormatAvailable

bool wxIsClipboardFormatAvailable(int dataFormat)

Returns TRUE if the given data format is available on the clipboard.

### ::wxOpenClipboard

bool wxOpenClipboard()

Opens the clipboard for passing data to it or getting data from it.

### ::wxRegisterClipboardFormat

int wxRegisterClipboardFormat(const wxString& formatName)

Registers the clipboard data format name and returns an identifier.

### ::wxSetClipboardData

bool wxSetClipboardData(int dataFormat, wxObject *data, int width, int height)

Passes data to the clipboard.

dataFormat may be one of:

- wxCF_TEXT or wxCF_OEMTEXT: data is a null-terminated text string.
- wxCF_BITMAP: data is a wxBitmap.
- wxCF_DIB: data is a wxBitmap. The bitmap is converted to a DIB (device independent bitmap).
- wxCF_METAFILE: data is a wxMetafile. width and height are used to give recommended dimensions.

The clipboard must have previously been opened for this call to succeed.