I am trying to create a C# application that runs in tray where I can drop files on it's icon. Is there any way to get the path of the file dropped on the System Tray icon? System.Windows.Forms.NotifyIcon does not have any events related to drag and drop.
+7
A:
Hello,
it's not possible to do this, the easy way. You can show a dummy Form, if the cursor is in a special area near the notifyicon. The dummy Form can get the filepath of the droped file.
Werewolve
2010-04-30 07:51:44
The workaround doesn't work either, you can't find out where the icon is located.
Hans Passant
2010-04-30 12:43:27
You can use the MouseUP Event from the NotifyIcon.....
Werewolve
2010-04-30 13:17:11
A:
It actually is possible to do with a slightly hacky method. Fluffy App does this for its file uploader. It uses Spifftastic which uses a pretty neat little method to identify the location of the tray icon. Then a transparent window is placed over the location of the icon and used as the actual drop target, but to the end user it all appears to be dropping the file on the icon.
Glenn Nelson
2010-10-27 02:09:08