# Function Reference

# _ClipBoard_GetPriorityFormat

Retrieves the first available clipboard format in the specified list

#include <Clipboard.au3>
_ClipBoard_GetPriorityFormat ( $aFormats )

## Parameters

$aFormats | Array with the following format: [0] - Number of formats (n) [1] - Format 1 [2] - Format 2 [n] - Format n

## Return Value

Success: | The first clipboard format in the list for which data is available
Failure: | Format not found due to: -1 - Clipboard has data, but not in any of the formats requested 0 - Clipboard is empty

## Related

_ClipBoard_CountFormats, _ClipBoard_EnumFormats

## See Also

Search GetPriorityClipboardFormat in MSDN Library.

## Example

    #include "Extras\HelpFileInternals.au3"

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

    Example()

    Func Example()
        Local $aFormats[3] = [2, $CF_TEXT, $CF_OEMTEXT]

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

        ; See if there is any text in the clipboard
        _MemoWrite("Priority formats .:. " & _ClipBoard_GetPriorityFormat($aFormats))
        _MemoWrite("Unicode available .: " & _ClipBoard_IsFormatAvailable($CF_UNICODETEXT))

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