udfClipSetEmpty
bln udfClipSetEmpty ()
;------------------------------------------------------------------------------------------------------------------------------------------
#DefineFunction udfClipSetEmpty ()
If !!DllCall ("USER32.DLL", long:"OpenClipboard", long:DllHwnd("")) Then Return !!DllCall ("USER32.DLL", long:"EmptyClipboard") && !!DllCall ("USER32.DLL", long:"CloseClipboard")
Return 0
;..........................................................................................................................................
; This function udfSetClipEmpty() returns a boolean value to indicate if the emptying was successful or not.
; The effect of emptying the clipboard by this function udfSetClipEmpty()
; can also easily be realized in WinBatch by applying the one statement ClipPut("").
;
; Remarks from MS SDK:
; The EmptyClipboard function empties the clipboard and frees handles to data in the clipboard.
; The function then assigns ownership of the clipboard to the window that currently has the clipboard open.
;
; Before calling EmptyClipboard, an application must open the clipboard by using the OpenClipboard function.
; If the application specifies a NULL window handle when opening the clipboard,
; EmptyClipboard succeeds but sets the clipboard owner to NULL.
;..........................................................................................................................................
; Detlev Dalitz.20030119
;..........................................................................................................................................
#EndFunction
;------------------------------------------------------------------------------------------------------------------------------------------


; Test.
ClipPut ("If you later see this message again, then emptying of the clipboard did not work.")
Message ("Demo: udfClipSetEmpty() - PRE-EMPTYING", ClipGet ())
blnResult = udfClipSetEmpty ()
Message("Demo: udfClipSetEmpty() - POST-EMPTYING", ClipGet ())
Exit
;------------------------------------------------------------------------------------------------------------------------------------------