开发者

C# Drag and drop to application taskbar icon

Is it p开发者_如何转开发ossible to drag and drop (files, text) to the taskbar icon of a WindowsForms application (C#)?

I know there's no easy way to do it for the tray icon (it involves using Win32 API and hooks), but I was wondering if it's possible for the taskbar.


That's not possible, but the window manager automatically restores the minimized window if you hover over it long enough in the taskbar. Once restored, you can access all the drop targets your window implements.


It is possible, at least in Windows 7. Note that the blog post which the two older answers refer to is from 2004. In Windows 7 and possibly previous versions, it is possible to drop files onto applications on the taskbar if you hold shift while dropping. Examples of applications that support this are Firefox, Internet Explorer, Notepad, etc.

In order to support it, your exe needs to be able to support the command line myapp.exe <some file path> and I believe you need registry entries similar to those described in this SO answer.

Update:

I added this to one of my applications, and it works. You do not need the registry entries.


This is fundamentally impossible.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜