Jump to content

WinEmptyClipbrd: Difference between revisions

From EDM2
Created page with "This function empties the clipboard, removing and freeing all handles to data that is in the clipboard. ==Syntax== WinEmptyClipbrd(hab) ==Parameters== ;hab (HAB) - input :..."
 
No edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
This function empties the clipboard, removing and freeing all handles to data that is in the clipboard.  
This function empties the clipboard, removing and freeing all handles to data that is in the clipboard.


==Syntax==
==Syntax==
Line 5: Line 5:


==Parameters==
==Parameters==
;hab (HAB) - input
;''hab'' (HAB) - input:Anchor-block handle.
:Anchor-block handle.  


==Returns==
;''rc'' (BOOL) - returns:Success indicator.
::TRUE - Successful completion
::FALSE - Error occurred.


==Returns==
;rc (BOOL) - returns
:Success indicator.
:;TRUE
::Successful completion
:;FALSE
::Error occurred.
==Remarks==
==Remarks==
The clipboard must be opened using WinOpenClipbrd before using this function.
The clipboard must be opened using [[WinOpenClipbrd]] before using this function.


This function will send a WM_DESTROYCLIPBOARD message to the clipboard owner.  
This function will send a WM_DESTROYCLIPBOARD message to the clipboard owner.
==Example Code==
==Example Code==
This example empties the clipboard (opened by WinOpenClipbrd), removing and freeing all handles to data in the clipboard.
This example empties the clipboard (opened by WinOpenClipbrd), removing and freeing all handles to data in the clipboard.
<pre>
<pre>
#define INCL_WINCLIPBOARD      /* Window Clipboard Functions   */
#define INCL_WINCLIPBOARD      /* Window Clipboard Functions */
#include <os2.h>
#include <os2.h>


BOOL  fSuccess;        /* success indicator                   */
BOOL  fSuccess;        /* success indicator                 */
HAB  hab;              /* anchor-block handle                 */
HAB  hab;              /* anchor-block handle               */
 


fSuccess = WinOpenClipbrd(hab);
fSuccess = WinOpenClipbrd(hab);
Line 34: Line 30:
if (fSuccess)
if (fSuccess)
   fSuccess = WinEmptyClipbrd(hab);
   fSuccess = WinEmptyClipbrd(hab);
</pre>
Definition
<pre>
#define INCL_WINCLIPBOARD /* Or use INCL_WIN, INCL_PM, */
#include <os2.h>
HAB    hab;  /*  Anchor-block handle. */
BOOL    rc;  /*  Success indicator. */
rc = WinEmptyClipbrd(hab);
</pre>
</pre>


Line 59: Line 43:
* [[WinSetClipbrdOwner]]
* [[WinSetClipbrdOwner]]
* [[WinSetClipbrdViewer]]
* [[WinSetClipbrdViewer]]
[[Category:Win]]
[[Category:Win]]

Latest revision as of 19:03, 10 April 2025

This function empties the clipboard, removing and freeing all handles to data that is in the clipboard.

Syntax

WinEmptyClipbrd(hab)

Parameters

hab (HAB) - input
Anchor-block handle.

Returns

rc (BOOL) - returns
Success indicator.
TRUE - Successful completion
FALSE - Error occurred.

Remarks

The clipboard must be opened using WinOpenClipbrd before using this function.

This function will send a WM_DESTROYCLIPBOARD message to the clipboard owner.

Example Code

This example empties the clipboard (opened by WinOpenClipbrd), removing and freeing all handles to data in the clipboard.

#define INCL_WINCLIPBOARD       /* Window Clipboard Functions */
#include <os2.h>

BOOL  fSuccess;         /* success indicator                  */
HAB   hab;              /* anchor-block handle                */

fSuccess = WinOpenClipbrd(hab);

if (fSuccess)
   fSuccess = WinEmptyClipbrd(hab);

Related Functions