I figure Cobb or Ben might have some insight into this.
A Windows interface called IDragSourceHelper can draw transparent images during drag and drop. It's what's responsible for transparent icons when you drag column headings or files around in Windows 2000 and up. To get started, it only requires some image information and a pointer to an IDataObject you have implemented.
It uses the IDataObject you implement to store some of its data (it says it does this to be "cross-process"). In Windows, OLE data is stored in a structure called a STGMEDIUM (storage medium), which is really just a type ID and a union of corresponding pointers. IDragSourceHelper requests to store a type called HGLOBAL (which is just a buffer) and IStream, a datatype that's a bit like a FILE. This is where I get confused.
It calls IDataObject::SetData to store these. I've never seen an example SetData implemented before so I really don't know what to do. I can make a copy of the HGLOBAL, but I don't know where to begin to copy an IStream. It's easy to read from an IStream, but I don't know how to create a new one.
[Win32] OLE IDataObject interface (SetData)
Moderator: MaxCoderz Staff
I've got the solution and it's not as simple as I thought. Refer to http://msdn2.microsoft.com/en-us/library/ms997502.aspx for details.
I can't believe that result was never in the top 50 on google. The result of this, anyway, is
I can't believe that result was never in the top 50 on google. The result of this, anyway, is