Name
SetClipboard -- set clipboard contents (V11.0)
Synopsis
int err = SetClipboard(struct hwClipboardData *data, struct hwTagList *t);
Function
This function must set the clipboard contents to the one specified in data. The data argument will be set to a pointer to a struct hwClipboardData which looks like this:

 
struct hwClipboardData
{
    int Type;
    APTR Data;
};

The structure members will be initialized as follows:

Type
This will be set to the type of data contained in the Data member of the structure. This will be one of the following values:

 
HWCLIPBOARDTYPE_TEXT
HWCLIPBOARDTYPE_IMAGE

See below how the actual data is passed for each of those types.

Data
This will be set to a pointer to the actual data that should be copied to the clipboard. The interpretation of Data depends on the data type that was passed in the Type structure member. The following data types are currently supported:

HWCLIPBOARDTYPE_TEXT
The Data member contains a NULL-terminated string that should be copied to the clipboard.

HWCLIPBOARDTYPE_IMAGE
The Data member contains a pointer to a struct hwClipboardImage which looks like this:

 
struct hwClipboardImage
{
    ULONG *Data;
    int Width;
    int Height;
    ULONG Flags;
};

This structure will contain the pixel data of the image that should be copied to the clipboard. The structure members will be initialized as follows:

Data
This contains the pixel data of the image as 32-bit ARGB values.

Width
Width of the image in pixels.

Height
Height of the image in pixels.

Flags
Currently unused. Always 0.

Inputs
data
data to be copied to the clipboard (see above)
tags
reserved for future use, always NULL currently
Results
err
error code or 0 for success

Show TOC