I am looking for an example how to implement IDropTarget within WebBrowser. As a 'base' code I will be using this answer.
Asked
Active
Viewed 413 times
2
-
@Ondrej Janacek, all I have is [interface code](http://pastebin.com/sKFdPU86), I don't know how to 'plug it in'. I have done a proper search, but have not found any examples for this. The closest thing I found is [here](http://www.itwriting.com/phorum/read.php?3,425,2801) (17th post). – hyto Nov 19 '13 at 08:38
1 Answers
1
In theory, you should wrap the original IDropTarget object, passed from MSHTML to you at IDocHostUIHandler::GetDropTarget, and return your own implementation of IDropTarget, which would forward all IDropTarget methods to that original object, with one exception: IDropTarget::DragEnter.
In your implementation of IDropTarget::DragEnter, you would check the IDataObject object which contains the data about to be dropped (IDataObject::EnumFormatEtc) and return DROPEFFECT_NONE if the data is not acceptable, otherwise forward it too.
I don't have a ready-to-use code sample for this. Feel free to experiment and post your own answer when you get there.
noseratio
- 59,932
- 34
- 208
- 486