Microsoft KB Archive/11654

{|
 * width="100%"|

INFO: Clipboard Memory Sharing in Windows

 * }

Q11654

-

The information in this article applies to:


 * Microsoft Win32 Software Development Kit (SDK)
 * Microsoft Windows Software Development Kit (SDK) versions 3.0, 3.1

-

SUMMARY
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 query words:

Keywords : kbClipboard kbOSWinNT kbOSWin2000 kbSDKWin32 kbGrpDSUser kbOSWin

Issue type : kbinfo

Technology : kbWin32SDKSearch kbAudDeveloper kbWin3xSearch kbSDKSearch kbWin32sSearch kbWinSDKSearch kbWinSDK300 kbWinSDK310