Closes the clipboard
#include <Clipboard.au3>
_ClipBoard_Close ( )
Success: | True |
Failure: | False |
When the window has finished examining or changing the clipboard close the clipboard by calling this function.
This enables other windows to access the clipboard. Do not place an object on the clipboard after calling this function.
Search CloseClipboard in MSDN Library.
#include <Clipboard.au3>
#include <GUIConstantsEx.au3>
#include <WinAPIError.au3>
#include <WindowsConstants.au3>
Global $g_idMemo
Example()
Func Example()
Local $hGUI
; Create GUI
$hGUI = GUICreate("Clipboard", 600, 400)
$g_idMemo = GUICtrlCreateEdit("", 2, 2, 596, 396, $WS_VSCROLL)
GUICtrlSetFont($g_idMemo, 9, 400, 0, "Courier New")
GUISetState(@SW_SHOW)
; Open the clipboard
If Not _ClipBoard_Open($hGUI) Then _WinAPI_ShowError("_ClipBoard_Open failed")
; Show clipboard formats available
MemoWrite("Clipboard formats ..: " & _ClipBoard_CountFormats())
; Empty the clipboard
If Not _ClipBoard_Empty() Then _WinAPI_ShowError("_ClipBoard_Empty failed")
; Show clipboard formats available
MemoWrite("Clipboard formats ..: " & _ClipBoard_CountFormats())
; Close the clipboard
_ClipBoard_Close()
; Loop until the user exits.
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc ;==>Example
; Write message to memo
Func MemoWrite($sMessage = "")
GUICtrlSetData($g_idMemo, $sMessage & @CRLF, 1)
EndFunc ;==>MemoWrite