Windows Interface Reference: Clipboard structure

# Clipboard

The clipboard is used as a way of copying data within an application or between applications.

    structure Clipboard :
      sig
        datatype ClipboardFormat =
            CF_NONE | CF_TEXT | CF_BITMAP | CF_METAFILEPICT | CF_SYLK | CF_DIF | CF_TIFF |
            CF_OEMTEXT | CF_DIB | CF_PALETTE | CF_PENDATA | CF_RIFF | CF_WAVE | CF_UNICODETEXT |
            CF_ENHMETAFILE | CF_OWNERDISPLAY | CF_DSPTEXT | CF_DSPBITMAP | CF_DSPMETAFILEPICT |
            CF_DSPENHMETAFILE | CF_PRIVATE of int | CF_GDIOBJ of int | CF_REGISTERED of int |
            CF_HDROP | CF_LOCALE

        type HBITMAP and HPALETTE and HWND and HDROP

        datatype CLIPHANDLE =
            CH_NONE |
            CH_TEXT of string |
            CH_BITMAP of HBITMAP |
            CH_METAFILEPICT of Metafile.METAFILEPICT |
            CH_SYLK of Word8Vector.vector |
            CH_DIF of Word8Vector.vector |
            CH_TIFF of Word8Vector.vector |
            CH_OEMTEXT of string |
            CH_DIB of Word8Vector.vector |
            CH_PALETTE of HPALETTE |
            CH_PENDATA of Word8Vector.vector |
            CH_RIFF of Word8Vector.vector |
            CH_WAVE of Word8Vector.vector |
            CH_UNICODETEXT of Word8Vector.vector |
            CH_ENHMETAFILE of Metafile.HENHMETAFILE |
            CH_OWNERDISPLAY of Word8Vector.vector |
            CH_DSPTEXT of Word8Vector.vector |
            CH_DSPBITMAP of Word8Vector.vector |
            CH_DSPMETAFILEPICT of Word8Vector.vector |
            CH_DSPENHMETAFILE of Word8Vector.vector |
            CH_PRIVATE of int * Word8Vector.vector |
            CH_GDIOBJ of int * Word8Vector.vector |
            CH_REGISTERED of int * Word8Vector.vector |
            CH_HDROP of HDROP |
            CH_LOCALE of Word8Vector.vector

        val ChangeClipboardChain : HWND * HWND -> bool
        val CloseClipboard : unit -> unit
        val CountClipboardFormats : unit -> int
        val EmptyClipboard : unit -> unit
        val EnumClipboardFormats : ClipboardFormat -> ClipboardFormat
        val GetClipboardData : ClipboardFormat -> CLIPHANDLE
        val GetClipboardFormatName : ClipboardFormat -> string
        val GetClipboardOwner : unit -> HWND
        val GetClipboardViewer : unit -> HWND
        val GetOpenClipboardWindow : unit -> HWND
        val GetPriorityClipboardFormat : ClipboardFormat list -> ClipboardFormat option
        val IsClipboardFormatAvailable : ClipboardFormat -> bool
        val OpenClipboard : HWND option -> unit
        val RegisterClipboardFormat : string -> ClipboardFormat
        val SetClipboardData : CLIPHANDLE -> unit
        val SetClipboardViewer : HWND -> HWND
      end

`datatype ClipboardFormat`
represents the various kinds of information which can be stored on the clipboard. As well as the formats defined in Windows the ML interface defines four extra formats. CF_NONE is used when no format is specified. CF_PRIVATE, CF_GDIOBJ and CF_REGISTERED are used for clipboard formats in the private range, GDI object range and registered format range.

`datatype CLIPHANDLE`
is used when extracting information from the clipboard or setting the clipboard contents.