Memory and the Clipboard A memory object that is to be placed on the clipboard should be allocated by using the GlobalAlloc function with the GMEM_MOVEABLE flag. After a memory object is placed on the clipboard, ownership of that memory handle is transferred to the system. When the clipboard is emptied and the memory object has one of the following clipboard formats, the system frees the memory object by calling the specified function: Function to free object Clipboard format CF_DSPENHMETAFILE CF_DSPMETAFILEPICT DeleteMetaFile CF_ENHMETAFILECF_METAFILEPICT CF_BITMAPCF_DSPBITMAP DeleteObject CF_PALETTE
CF_DIBCF_DIBV5CF_DSPTEXT CF_OEMTEXT GlobalFree CF_TEXTCF_UNICODETEXT CF_OWNERDISPLAY None When the clipboard is emptied of a CF_OWNERDISPLAY object, the application itself must free the memory object.以上是msdn的解释,翻译后的大概意思就是说,当你用标准的数据格式的时候,当EmptyClipboard函数被调用的时候,系统自动会调用相应的释放函数进行内存释放。
A memory object that is to be placed on the clipboard should be allocated by using the
GlobalAlloc function with the GMEM_MOVEABLE flag. After a memory object is placed on the clipboard, ownership of that memory handle is
transferred to the system. When the clipboard is emptied and the memory object has one
of the following clipboard formats,
the system frees the memory object by calling the specified function: Function to free object Clipboard format CF_DSPENHMETAFILE CF_DSPMETAFILEPICT DeleteMetaFile CF_ENHMETAFILECF_METAFILEPICT
CF_BITMAPCF_DSPBITMAP DeleteObject CF_PALETTE
CF_DIBCF_DIBV5CF_DSPTEXT CF_OEMTEXT GlobalFree CF_TEXTCF_UNICODETEXT
CF_OWNERDISPLAY None When the clipboard is emptied of a CF_OWNERDISPLAY object, the application itself must free the memory object.以上是msdn的解释,翻译后的大概意思就是说,当你用标准的数据格式的时候,当EmptyClipboard函数被调用的时候,系统自动会调用相应的释放函数进行内存释放。