Implementing drag-drop from Chrome on my .NET Windows form

删除回忆录丶 提交于 2019-11-28 19:32:58
Pedery

I've pulled kilometers of hair out of my head myself regarding weird drag-drop behaviour. Spy++ as mentioned by sixlettervariables might be a good idea. Another would be to take a look at the discussion from one of my Q/As here at SO:

Drag and Drop between Instances of the same Windows Forms Application

From my own experience I seem to remember that drag/drop from a browser is a security issue and thus handled differently. Hope this helps.

EDIT:

Maybe this answers your question:

http://www.vbforums.com/showthread.php?t=529211

Have you considered using Spy++ to see what messages are sent from Chrome to Windows Explorer? Spy++ has message logging which has helped me in the past with strange behavior. You can enable logging of WM_DROPFILES, etc.

Arunas

Strangely, I only get shortcuts when dragging files from Chrome.

Anyway, in case Chrome does the drag & drop with virtual sources, that is, it downloads the file and generates the content on drag & drop completion, you have to implement shell interface IDropTarget. I get the feeling the file contents might be transferred via IStream which is not supported by .NET Drag&Drop.

Maybe this http://msdn.microsoft.com/en-us/library/bb776904%28VS.85%29.aspx#copying and this Drag and drop virtual files using IStream should get you on the right path.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!