Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Drag and Drop onto Desktop Icon

I think this should be simple. I have looked at similar questions here but it is not clear to my old brain as to how it should work. I have a Windows Forms Application. My users want to drag a file over the application icon on the desktop and execute the program with that file. So what I would like to do is:

Accept the dropped file on the icon; start the application and place the file path details into a textbox so that the user can process it.

The application is written in C#

Thanks

like image 678
ScruffyDuck Avatar asked May 02 '11 08:05

ScruffyDuck


1 Answers

Try the following:

class Program
{
   static void Main(string[] args)
   {
       // args[0] is the file
   }
}
like image 82
Petar Minchev Avatar answered Oct 22 '22 07:10

Petar Minchev