OPEN-CLIPBOARD Action

This document covers the following topics:


Description

Empties the current contents (if any) of the local clipboard, and opens it for writing (see the SET-CLIPBOARD-DATA action). The contents of the global (Windows) clipboard are not modified by this action.

Each Natural process has its own local clipboard that is used to build up data destined either for the Windows clipboard, or for the target of a drag-drop operation. In the latter case, the local clipboard of the source process is also referred to as the "drag-drop clipboard".

This action allows a clipboard owner to optionally be set. If an owner is specified, the data is stored with the owner, and is retrieved from the owner by the Windows clipboard whenever the clipboard data is requested. If the owner is destroyed, Natural implicitly flushes the data to the Windows clipboard to ensure that it remains available. Although there is usually little or no impact from these internal activites on the application itself, it is recommended that, if the handle of the control (if any) sourcing the data be specified as the owner. For example, if the data corresponding to some selected list box items is to be placed on the clipboard, it is recommended that the clipboard owner be specified as the handle of the list box to which these list box items belong.

Note that if data for a drag-drop operation is being prepared in the Begin-Drag event, an explicit call to this action is not necessary, since Natural implicitly opens the drag-drop clipboard in this case.

Parameters

Name/Data Type Explanation
HANDLE OF GUI Input (optional parameter)

The handle of the dialog or dialog element owning the clipboard (see above). If this parameter is omitted, or is specified as NULL-HANDLE (default), the clipboard has no owner.

Response (I4) Output

Natural error (if applicable).

Example:

PROCESS GUI ACTION OPEN-CLIPBOARD WITH #LB-1 
GIVING #RESPONSE