Windows Clipboard Formats
Jochen Arndt - 07/Mar/2018
Jochen Arndt - 07/Mar/2018
[SHOWTOGROUPS=4,20]
An overview of clipboard and Drag & Drop object formats.
Introduction
This reference gives you an overview of standard and common clipboard formats with links to the data structures.
Definitions
The following type definitions are used in the below tables:
Links indicate the destination in brackets. For MSDN links in the tables the indication is omitted.
Standard Clipboard Formats
The Standard Clipboard Formats [MSDN] use numeric IDs defined in WinUser.h. All non-standard formats must be registered using a unique format name.
Shell Clipboard Formats
The Shell Clipboard Formats [MSDN] are used to transfer shell objects via clipboard and Drag & Drop.
For most of them there is a definition for the format name in the header file shlobj.h:
[/SHOWTOGROUPS]
An overview of clipboard and Drag & Drop object formats.
Introduction
This reference gives you an overview of standard and common clipboard formats with links to the data structures.
Definitions
The following type definitions are used in the below tables:
- ANSI textNull terminated ANSI or multi byte string.
- Unicode textNull terminated Unicode (UTF-16LE) string.
- ANSI / Unicode text listList of null terminated strings followed by a NULL character (double NULL terminated).
- ASCII / ANSI textASCII 7-bit text by definition but ANSI 8-bit text may be supported.
- DWORD (BOOL)DWORD value representing a boolean value (true if not zero).
Links indicate the destination in brackets. For MSDN links in the tables the indication is omitted.
Standard Clipboard Formats
The Standard Clipboard Formats [MSDN] use numeric IDs defined in WinUser.h. All non-standard formats must be registered using a unique format name.
Format Identifier | Data Type | Description |
---|---|---|
CF_TEXT (1) | ANSI text | Text. |
CF_BITMAP (2) | HBITMAP | Handle to a bitmap (GDI object). |
CF_METAFILEPICT (3) | METAFILEPICT | Windows-Format Metafiles picture. |
CF_SYLK (4) | ANSI text | Microsoft Symbolic Link [Wikipedia]. |
CF_DIF (5) | ASCII text | Software Arts Data Interchange Format [Wikipedia]. |
CF_TIFF (6) | TIFF [Wikipedia] | TIFF image. |
CF_OEMTEXT (7) | 8-Bit DOS text | Text. |
CF_DIB (8) | BITMAPINFO | Structure followed by bitmap bits. |
CF_PALETTE (9) | HPALETTE | Handle to a color palette (GDI object). |
CF_PENDATA (10) | - | Windows 3.1 pen extension data. |
CF_RIFF (11) | RIFF | Resource Interchange File Format (RIFF) audio. |
CF_WAVE (12) | WAVE | WAVE audio. |
CF_UNICODETEXT (13) | Unicode text | Text. |
CF_ENHMETAFILE (14) | HENHMETAFILE | Enhanced-Format Metafiles handle. |
CF_HDROP (15) | DROPFILES | List of file names. |
CF_LOCALE (16) | DWORD (LCID) | LCID for CF_TEXT to CF_UNICODE conversion. |
CF_DIBV5 (17) | BITMAPV5HEADER | Structure followed by bitmap bits |
CF_DSPTEXT (0x0081) | ANSI text | Text. |
CF_DSPBITMAP (0x0082) | HBITMAP | Handle to a bitmap (GDI object) |
CF_DSPMETAFILEPICT (0x0083) | METAFILEPICT | Windows-Format Metafiles picture. |
CF_DSPENHMETAFILE (0x008E) | HENHMETAFILE | Enhanced-Format Metafiles handle. |
Shell Clipboard Formats
The Shell Clipboard Formats [MSDN] are used to transfer shell objects via clipboard and Drag & Drop.
For most of them there is a definition for the format name in the header file shlobj.h:
Definition | Format Name |
---|---|
CFSTR_SHELLIDLIST | Shell IDList Array |
CFSTR_SHELLIDLISTOFFSET | Shell Object Offsets |
CFSTR_NETRESOURCES | Net Resource |
CFSTR_FILEDESCRIPTORA | FileGroupDescriptor |
CFSTR_FILEDESCRIPTORW | FileGroupDescriptorW |
CFSTR_FILECONTENTS | FileContents |
CFSTR_FILENAMEA | FileName |
CFSTR_FILENAMEW | FileNameW |
CFSTR_PRINTERGROUP | PrinterFriendlyName |
CFSTR_FILENAMEMAPA | FileNameMap |
CFSTR_FILENAMEMAPW | FileNameMapW |
CFSTR_SHELLURL | UniformResourceLocator |
CFSTR_INETURLA | UniformResourceLocator |
CFSTR_INETURLW | UniformResourceLocatorW |
CFSTR_PREFERREDDROPEFFECT | Preferred DropEffect |
CFSTR_PERFORMEDDROPEFFECT | Performed DropEffect |
CFSTR_PASTESUCCEEDED | Paste Succeeded |
CFSTR_INDRAGLOOP | InShellDragLoop |
CFSTR_DRAGCONTEXT | DragContext |
CFSTR_MOUNTEDVOLUME | MountedVolume |
CFSTR_PERSISTEDDATAOBJECT | PersistedDataObject |
CFSTR_TARGETCLSID | TargetCLSID |
CFSTR_LOGICALPERFORMEDDROPEFFECT | Logical Performed DropEffect |
CFSTR_AUTOPLAY_SHELLIDLISTS | Autoplay Enumerated IDList Array |
CFSTR_UNTRUSTEDDRAGDROP | UntrustedDragDrop |
CFSTR_FILE_ATTRIBUTES_ARRAY | File Attributes Array |
CFSTR_INVOKECOMMAND_DROPPARAM | InvokeCommand DropParam |
CFSTR_SHELLDROPHANDLER | DropHandlerCLSID |
CFSTR_DROPDESCRIPTION | DropDescription |
Format Name | Data Type | Description |
---|---|---|
AsyncFlag | DWORD (BOOL) | Perform insert/paste operation in the background. Used by Explorer to avoid blocking the current instance. |
FileContents | Binary | File content. |
FileGroupDescriptor | FILEGROUPDESCRIPTOR | Array of FILEDESCRIPTORs. |
FileGroupDescriptorW | FILEGROUPDESCRIPTOR | Array of FILEDESCRIPTORs. |
FileName | ANSI text | Single file name in short (8.3) format. |
FileNameW | Unicode text | Single file name. |
FileNameMap | ANSI text list | List of file names when renaming. |
FileNameMapW | Unicode text list | List of file names when renaming. |
MountedVolume | Unicode text | Path for mounted volume. |
Shell IDList Array | CIDA | Array of PIDL (pointer to ITEMIDLIST) offsets. |
Autoplay Enumerated IDList Array | CIDA | Array of PIDL (pointer to ITEMIDLIST) offsets. |
Shell Object Offsets | POINT[] | Array of points. |
File Attributes Array | FILE_ATTRIBUTES_ARRAY | Array of file attributes. |
Net Resource | NRESARRAY | Array of NETRESOURCE structures. |
PrinterFriendlyName | DROPFILES | List of printer names. |
UniformResourceLocator | ANSI text | URL |
UniformResourceLocatorW | Unicode text | URL |
[/SHOWTOGROUPS]