Clipboard Memory Sharing in Windows

Last reviewed: November 2, 1995
Article ID: Q11654
The information in this article applies to:
  • Microsoft Windows Software Development Kit (SDK) for Windows versions 3.0 and 3.1
  • Microsoft Win32 Application Programming Interface (API) included with:

        - Microsoft Windows NT versions 3.5 and 3.51
        - Microsoft Windows 95 version 4.0
    

The following are questions and answers on the topic of Clipboard memory sharing:

Q. Does the Clipboard UNLOCK before freeing the handle when I tell it to

   SetClipboardData()?

A. Yes, the Clipboard UNLOCKs before freeing the handle when you
   SetClipboardData().

Q. Does the Clipboard actually copy my global storage to another
   block, or does it just retain the value of my handle for
   referencing my block?

A. The Clipboard is sharable; it retains the value of the handle.

Q. Does GetClipboardData() remove the data from the Clipboard, or

   does it allow me to reference the data without removing it from
   the Clipboard?

A. The data handle returned by GetClipboardData() is controlled by
   the Clipboard, not by the application. The application should
   copy the data immediately, instead of relying on the data handle
   for long-term use. The application should not free the data
   handle or leave it locked. To remove data from the Clipboard,
   call SetClipboardData().


Additional reference words: 3.00 3.10 3.50 3.51 4.00 95
KBCategory: kbui
KBSubcategory: UsrClp


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: November 2, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.