0
votes

I would like to have a function for my application such that dragging any file in Windows Explorer to a file having the correct format for my application adds that first file to the second, like with WinZip, 7-zip etc. Example, if I drag a file onto another zip file, it initiates the default application for Zip (in my case 7-zip) and adds it to the zip archive I drop it onto.

I've tried searching for a way to do this on Google, but I don't know what this type of function would be called or the correct keywords I should use. Referencing drag and drop, shell extensions etc. all points me to dragging a file from the Shell into my application or vice versa which I know how to do. Can anyone point me in the direction of what I should be searching for, or even better has some example code/tutorial on how to achieve this?

1

1 Answers

1
votes

Well, searching for Shell extensions was correct. There is a github project that makes it easy to create shell extensions in .Net: https://github.com/dwmkerr/sharpshell

One of them is a drop handler, and that is what you're looking for if I understand your question right. There are some tutorials on how to use SharpShell on CodeProject, this one specific for the drop handler: http://www.codeproject.com/Articles/529515/NET-Shell-Extensions-Shell-Drop-Handlers