Function Reference

_ClipBoard_EnumFormats

クリップボード上で現在利用可能なデータ形式を列挙します。

#Include <Clipboard.au3>
_ClipBoard_EnumFormats($iFormat)

 

パラメータ

$iFormat 利用可能であることがわかっているクリップボード形式を指定します。形式の列挙を開始するには$iFormatをゼロに指定してください。$iFormatがゼロの場合、この関数は最初の利用可能なクリップボード形式を取得します。列挙中の以降の呼び出しのために、$iFormatは前回の呼び出し結果に設定してください。

 

返し値

成功: 指定した形式の次のクリップボード形式
失敗: 0

 

注意

形式を列挙する前にクリップボードを開く必要があります

 

関連

_ClipBoard_Open, _ClipBoard_CountFormats, _ClipBoard_GetPriorityFormat, _ClipBoard_RegisterFormat

 

こちらも参照

MSDNライブラリのEnumClipboardFormatsを検索して下さい。

 


#include <GuiConstantsEx.au3>
#include <ClipBoard.au3>
#include <WinAPI.au3>
#include <WindowsConstants.au3>

Opt('MustDeclareVars', 1)

Global $iMemo

_Main()

Func _Main()
    Local $hGUI, $iFormat, $iCount

    ; GUI作成
    $hGUI = GUICreate("Clipboard", 600, 400)
    $iMemo = GUICtrlCreateEdit("", 2, 2, 596, 396, $WS_VSCROLL)
    GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New")
    GUISetState()

    ; クリップボードを開く
    If Not _ClipBoard_Open ($hGUI) Then _WinAPI_ShowError ("_ClipBoard_Open failed")

    ; 利用可能なクリップボード形式を表示
    MemoWrite("Clipboard formats ..: " & _ClipBoard_CountFormats ())

    ; クリップボード形式を列挙
    Do
        $iFormat = _ClipBoard_EnumFormats ($iFormat)
        If $iFormat <> 0 Then
            $iCount += 1
            MemoWrite("Clipboard format " & $iCount & " .: " & _ClipBoard_FormatStr ($iFormat))
        EndIf
    Until $iFormat = 0

    ; クリップボードを閉じる
    _ClipBoard_Close ()

    ; ユーザーが終了させるまでループ
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE

EndFunc   ;==>_Main

; メモにメッセージを書き込む
Func MemoWrite($sMessage = "")
    GUICtrlSetData($iMemo, $sMessage & @CRLF, 1)
EndFunc   ;==>MemoWrite