I wonder if anyone knows if there's any way to start OLE file drag from a C++ Win32 application without blocking until the drag completed.
I'm currently using DoDragDrop() to start the drag operation, but this function doesn't return until the drag operation is completed. The problem with this is that the animation in my program halts while a drag is in progress.
I tried to launch this command from a new thread, but that didn't work, even if I called OleInitialize() in this thread.
The only thing I found that was related to this is doing the data operation afterwards (such as copying/moving the file/data) asynchronously. In my application drag&drop is not used for such operations, so it isn't an issue, and the main issue is the block while the user is performing the drag. Edit: To be more clear about this: IAsyncOperation on the DataObject isn't a solution to this problem, because it only makes the operation occuring after the data has been dropped assynchronous. The problem I have is the blocking behavior from the point where the user starts dragging until the moment he releases the mouse button.
2 solutions do come to mind, but I hope there will be an easier or better way to achieve this.
Implement my own (non-ole) drag&drop. This would be more work to do, and I actually found it a nice feature that it was possible to drag files from within my program to other programs as well.
Create/launch a new process and start the drag operation from there. Since I have no problems when dragging a file from windows explorer inside my application, I think this might work. The drag should start immediately though, and I have no idea if creating a new process takes any noticeable time.