# Function Reference

# _ClipBoard_RegisterFormat

Registers a new clipboard format

#include <Clipboard.au3>
_ClipBoard_RegisterFormat ( $sFormat )

## Parameters

$sFormat | The name of the new format

## Return Value

Success: | The registered clipboard format
Failure: | 0

## Remarks

If a registered format with the specified name already exists, a new format is not registered and the return value identifies the existing format. This enables more than one application to copy and paste data using the same registered clipboard format. Note that the format name comparison is case-insensitive.

## Related

_ClipBoard_EnumFormats

## See Also

Search RegisterClipboardFormat in MSDN Library.

## Example

    #include "Extras\HelpFileInternals.au3"

    #include <Clipboard.au3>
    #include <GUIConstantsEx.au3>
    #include <WinAPIError.au3>
    #include <WindowsStylesConstants.au3>

    Example()

    Func Example()
        Local $iFormat

        ; Create GUI
        GUICreate("Clipboard", 600, 400)
        _MemoCreate(2, 2, 596, 396, $WS_VSCROLL)
        GUISetState(@SW_SHOW)

        ; Register a new clipboard format
        $iFormat = _ClipBoard_RegisterFormat("AutoIt Library Text")
        If $iFormat <> 0 Then

            ; Show new format
            _MemoWrite(_ClipBoard_GetFormatName($iFormat))
        Else
            _WinAPI_ShowError("_ClipBoard_RegisterFormat failed")
        EndIf

        ; Loop until the user exits.
        Do
        Until GUIGetMsg() = $GUI_EVENT_CLOSE
    EndFunc   ;==>Example