stanley chuks
stanley chuks

Reputation: 13

Pass Drop Event on to a Folder using C++

I have a program that acts as a Drop-target for OLE Drag and Drop. (Based on http://www.catch22.net/tuts/ole-data-transfers)

My Question is if it possible to pass on this Drop Event on a Folder - like Temp Folder. As in, the User drops on a GUI (which is the drop-target), this drop-target sends the drop to Explorer.

Something like sending Message to Folder -

SendMessage((HWND) folder_hwnd, WM_OLEDROP, (WPARAM)pDataObject, 0);   //Pseudo-code

Thanks.

Upvotes: 0

Views: 388

Answers (1)

Jonathan Potter
Jonathan Potter

Reputation: 37202

You can simulate a drag-and-drop onto a folder using the following steps:

  1. Obtain the PIDL for the target folder e.g. using SHParseDisplayName
  2. Obtain an IShellFolder for the target folder e.g. using SHBindToObject
  3. Bind to the folder's IDropTarget interface using IShellFolder::GetUIObjectOf

You can then simulate a drop to the folder using the various methods of the IDropTarget interface.

Upvotes: 2

Related Questions