Function Reference


_ClipBoard_Empty

Empties the clipboard and frees handles to data in the clipboard

#include <Clipboard.au3>
_ClipBoard_Empty ( )

Return Value

Success: True
Failure: False

Remarks

Before calling this function, you must open the clipboard by using the _ClipBoard_Open() function.
If you specified a NULL window handle when opening the clipboard, this function succeeds but sets the clipboard owner to NULL.
Note that this causes _ClipBoard_SetData() to fail.

Related

_ClipBoard_GetOwner, _ClipBoard_Open, _ClipBoard_SetData, _ClipBoard_SetDataEx

See Also

Search EmptyClipboard in MSDN Library.

Example

#include "Extras\HelpFileInternals.au3"

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

Example()

Func Example()
    Local $hGUI

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

    ; Open the clipboard
    If _ClipBoard_Open($hGUI) Then
        ShowData($hGUI)

        ; Empty the clipboard
        If Not _ClipBoard_Empty() Then _WinAPI_ShowError("_ClipBoard_Empty failed")

        ; Close the clipboard
        _ClipBoard_Close()
    Else
        _WinAPI_ShowError("_ClipBoard_Open failed")
    EndIf

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

; Show clipboard statistics
Func ShowData($hGUI)
    _MemoWrite("GUI handle ............: " & $hGUI)
    _MemoWrite("Clipboard owner .......: " & _ClipBoard_GetOwner())
    _MemoWrite("Clipboard open window .: " & _ClipBoard_GetOpenWindow())
    _MemoWrite("Clipboard sequence ....: " & _ClipBoard_GetSequenceNumber())
    _MemoWrite()
EndFunc   ;==>ShowData