Using Cut and Paste

The following three scenarios describe the clipboard functions:

  • Cut and Paste from a Windows Application in a VDM to another application in a separate VDM; Public is deselected.

  • Cut and Paste between two Windows applications within the same VDM (MAVDM).

  • Cut and Paste between the OS/2 and Windows environments. Cut and Paste within the OS/2 environment remains essentially unchanged.

    Scenario 1 - Cut/Paste Between Independent WIN-OS/2 Sessions

  • Cut the data into the local Windows VDM clipboard.

  • Select Export from the clipboard pull-down menu. The data is copied into the external clipboard.

  • Select the VDM containing the destination Windows application.

  • Select Import from the clipboard pull-down menu. The data is copied from the external clipboard into the local clipboard of the receiving VDM.

  • Paste the data into the destination Windows application.

    Note: Steps 2 and 4 above are not necessary if the clipboard is public in the source and destination VDM.

    Scenario 2 - Cut/Paste Within A MAVDM

  • Cut the data into the Windows VDM clipboard

  • Paste the data from the clipboard into the destination application.

    Scenario 3 - Cut/Paste Between OS/2 And WIN-OS/2

    The OS/2 V2.0 clipboard is activated upon loading the operating system. A new OS/2 utility named CLIPVIEW.EXE is located in the OS2\APPS\ directory, and has been provided to support the extended clipboard functions. CLIPVIEW.EXE must be started in order to view and transfer the contents of the OS/2 V2.0 clipboard.

    With the exception of the File option of the Windows clipboard, the same pull-down menus are provided. The Render option is the same as the Display option in the Windows clipboard. Render will display the contents of the clipboard in a number of different formats. Because the contents of the clipboard are stored in separate areas in memory, it is possible to view both the ASCII (text) and graphics contents of the clipboard.

    Note: An application may or may not clear the entire contents of the clipboard, prior to copying data to it. For example, the system editor will always erase the entire Presentation Manager clipboard, and therefore any public Windows clipboard as well, before it copies its text data into it. On the other hand, some of the Presentation Manager applications do not behave that way. They will only override the specific data areas which are copied into the clipboard and leave the other ones in the clipboard unchanged.

    The global Windows VDM clipboard is visible to the Presentation Manager clipboard. CLIPVIEW.EXE has been enhanced to perform the following two activities:

  • Update the Presentation Manager clipboard when changes are made to the global VDM Clipboard

  • Update the global Windows VDM clipboard when changes are made to the Presentation Manager clipboard.

    The Presentation Manager clipboard server application is registered as "clipboard viewer" to receive notification of clipboard updates. This ensures that the following messages are forwarded to the clipboard server, so that when updates are made to the Presentation Manager clipboard, messages are sent to the Presentation Manager CLIPVIEW.EXE.

  • WM_DESTROYCLIPBOARD: Signals that the contents of the clipboard are being destroyed

  • WM_DRAWCLIPBOARD: Signals an application to notify the next application in the chain of a change to the clipboard

  • WM_HSCROLLCLIPBOARD: Requests horizontal scrolling of the clipboard contents

  • WM_PAINTCLIPBOARD: Requests painting of the contents of the clipboard

  • WM_RENDERALLFMTS: Notifies the owner of the clipboard that it must render clipboard data in all possible formats

  • WM-RENDERFMT: Notifies the clipboard owner that it must format the last data copied to the clipboard

  • WM_SIZECLIPBOARD: Notifies the clipboard owner that the clipboard application's window size has changed

  • WM_VSCROLLCLIPBOARD: Requests vertical scrolling of the clipboard contents.

    Note: No changes have been made to the Presentation Manager API functions to accommodate this design. Presentation Manager applications will not notice any difference; there appears to be just one (Presentation Manager) clipboard as it always used to be. The same is true for Windows applications as well.

    Data formats are translated from Presentation Manager to Windows formats and vice versa, as required. This translation is performed when data is placed in the global clipboard. The following data formats will be translated between Presentation Manager and Windows:

    Windows DIB bitmaps:

    Windows bitmaps: Windows Metafiles: PM Metafiles: Text:


    [Back: WIN-OS/2 Clipboard Support]
    [Next: Dynamic Data Exchange]