I don't want to sound foolish but I can almost swear I have read that the system owns the memory after that and the system wil free it by calling the correct free command , unless you alloc with some owner type of type (forgot the name)

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
DeleteMetaFile CF_DSPENHMETAFILE
CF_DSPMETAFILEPICT
CF_ENHMETAFILE
CF_METAFILEPICT
DeleteObject CF_BITMAP
CF_DSPBITMAP
CF_PALETTE
GlobalFree CF_DIB
CF_DIBV5
CF_DSPTEXT
CF_OEMTEXT
CF_TEXT
CF_UNICODETEXT
none CF_OWNERDISPLAY
When the clipboard is emptied of a CF_OWNERDISPLAY object, the application itself must free the
memory object.

Last edited by Wjbender; 04/02/15 10:07.

Compulsive compiler