Jump to content

WinOpenClipbrd: Difference between revisions

From EDM2
Created page with "This function opens the clipboard. ==Syntax== WinOpenClipbrd(hab) ==Parameters== ;hab (HAB) - input :Anchor-block handle. ;rc (BOOL) - returns :Success indicator. :;TRUE..."
 
Ak120 (talk | contribs)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
This function opens the clipboard.  
This function opens the clipboard.


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


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


;rc (BOOL) - returns
:Success indicator.
:;TRUE
::Clipboard successfully opened
:;FALSE
::Error occurred.
==Returns==
==Returns==
;rc (BOOL) - returns
;rc (BOOL) - returns:Success indicator.
::Success indicator.
::TRUE - Clipboard successfully opened
:;TRUE
::FALSE - Error occurred.
::Clipboard successfully opened  
 
:;FALSE
::Error occurred.
==Remarks==
==Remarks==
The process reading the clipboard does not become the owner of the object in it; it must not update or free the object.
The process reading the clipboard does not become the owner of the object in it; it must not update or free the object.
Line 28: Line 19:
If another thread or process already has the clipboard open, this function does not return until the clipboard is closed.
If another thread or process already has the clipboard open, this function does not return until the clipboard is closed.


Messages can be received from other threads and processes during the processing of this function.  
Messages can be received from other threads and processes during the processing of this function.
 
==Example Code==
==Example Code==
This example opens the clipboard for use by the current process.
This example opens the clipboard for use by the current process.
Line 39: Line 31:


fSuccess = WinOpenClipbrd(hab);
fSuccess = WinOpenClipbrd(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 = WinOpenClipbrd(hab);
</pre>
</pre>



Latest revision as of 03:02, 12 December 2023

This function opens the clipboard.

Syntax

WinOpenClipbrd(hab)

Parameters

hab (HAB) - input
Anchor-block handle.

Returns

rc (BOOL) - returns
Success indicator.
TRUE - Clipboard successfully opened
FALSE - Error occurred.

Remarks

The process reading the clipboard does not become the owner of the object in it; it must not update or free the object.

This function prevents other threads and processes from examining or changing the clipboard contents.

If another thread or process already has the clipboard open, this function does not return until the clipboard is closed.

Messages can be received from other threads and processes during the processing of this function.

Example Code

This example opens the clipboard for use by the current process.

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

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

fSuccess = WinOpenClipbrd(hab);

Related Functions