Convertible clipboard formats
Microsoft Windows natively supports different clipboard formats. When copying and pasting clipboard content, Windows will automatically attempt to convert the clipboard data to other compatible clipboard formats, making it easier to paste the content into different applications.
When data formats are posted to the clipboard, Windows will automatically add additional formats that can be obtained by converting from any of the formats that were originally posted in order to increase the likelihood of successful pasting into other applications.
Windows will then automatically convert the clipboard data from one format to another if the target application requests a format that the source cannot directly provide.
For example, when copying formatted text from a Word processor, Windows will make other formats available to a requesting application, such as plain text as well as the originally posted formatted text.
As another example, if the clipboard data contains plain text data in the CF_TEXT clipboard format and the application that the data is pasted into requests Unicode text in the format of CF_UNICODETEXT, Windows will automatically convert the clipboard data during the pasting process.
Note:
With some conversion, information might be lost, for example with automatically converting rich text to plain text.
Clipboard Format | Description |
---|---|
CF_TEXT
|
CF_TEXT |
CF_OEMTEXT | |
CF_UNICODETEXT | |
CF_LOCALE | |
CF_BITMAP
|
CF_BITMAP |
CF_DIB | |
CF_DIBV5 | |
CF_METAFILEPICT
|
CF_METAFILEPICT |
CF_ENHMETAFILE | |
CF_OEMTEXT
|
CF_TEXT |
CF_OEMTEXT | |
CF_UNICODETEXT | |
CF_LOCALE | |
CF_DIB
|
CF_BITMAP |
CF_DIB | |
CF_DIBV5 | |
CF_UNICODETEXT
|
CF_TEXT |
CF_OEMTEXT | |
CF_UNICODETEXT | |
CF_LOCALE | |
CF_ENHMETAFILE
|
CF_METAFILEPICT |
CF_ENHMETAFILE | |
CF_DIBV5
|
CF_BITMAP |
CF_DIB | |
CF_DIBV5 |
Note:
The clipboard format conversion is Windows OS dependent and this table could change in future OS versions.
It’s important to understand that the Windows clipboard system doesn’t convert between all formats freely. Automatic conversions, are limited to a few core types, primarily between different text encodings and between bitmap variations.
For most other formats, compatibility is achieved when the source application places multiple formats onto the clipboard at once. For example, when you copy a chart from Excel, it might place the data as an Office Drawing Shape (CFX_OfficeDrawingShape), an Enhanced Metafile (CF_ENHMETAFILE), and a simple Bitmap (CF_DIB). This isn’t a conversion by the clipboard, but rather the source application providing multiple representations for different pasting scenarios.
Clipboard Format control & convertible formats
Convertible formats should be taken into consideration when designing the clipboard format control policies and the cross session clipboard configuration. For example, if you want to explicitly allow only text-based content to be copied from the client to the clipboard, you must add all text-based formats to the “Session Clipboard Write Allowed Formats” policy. In this example, you must add the following formats to the policy:
CF_TEXT
CF_UNICODETEXT
CF_DSPTEXT
CF_LOCALE
CF_OEMTEXT
Likewise, if you want to funnel all file formats through cross session when copying those types of data from one session to another, you will need to add all the file clipboard formats to the CrossSessionFormats configuration:
CFX_FILES
CFX_HFDROP