So I need to allocate memory and get an hMem handle to pass to the SetClipboardData function. Which should I be using, the GlobalAlloc or LocalAlloc functions?
And when getting data out of the clipboard, do I need to be using LocalLock or GlobalLock on the returned hMem handle from the GetClipboardData function, in order to access the returned data?
And as for destroying the memory, I know it says that the system takes over the memory object when the clipboard is open, but what about after I close the clipboard with the CloseClipboard function? Then does that return control of the memory object to me (after the system copies the content of the memory object into its own internal clipboard buffer), such that I can then destroy my no longer needed memory object with GlobalFree or LocalFree? Or is the clipboard supposed to keep control of my memory object, and only deallocate the memory when I empty the clipboard?
And when getting data out of the clipboard, do I need to be using LocalLock or GlobalLock on the returned hMem handle from the GetClipboardData function, in order to access the returned data?
And as for destroying the memory, I know it says that the system takes over the memory object when the clipboard is open, but what about after I close the clipboard with the CloseClipboard function? Then does that return control of the memory object to me (after the system copies the content of the memory object into its own internal clipboard buffer), such that I can then destroy my no longer needed memory object with GlobalFree or LocalFree? Or is the clipboard supposed to keep control of my memory object, and only deallocate the memory when I empty the clipboard?