C# 拖放到应用程序任务栏图标
是否可以将(文件、文本)拖放到 WindowsForms 应用程序 (C#) 的任务栏图标上?
我知道对于托盘图标没有简单的方法(它涉及使用 Win32 API 和挂钩),但我想知道对于任务栏是否可以。
Is it possible 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这是不可能的,但窗口管理器会自动如果您将鼠标悬停在任务栏中的窗口上足够长的时间,则会恢复最小化的窗口。恢复后,您可以访问窗口实现的所有放置目标。
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.
这是可能的,至少在 Windows 7 中是可能的。请注意,两个旧答案引用的博客文章来自 2004 年。在 Windows 7 和可能以前的版本中,可以将文件拖放到应用程序上如果您在放下时按住 Shift 键,则会出现任务栏。支持此功能的应用程序示例有 Firefox、Internet Explorer、记事本等。
为了支持它,您的 exe 需要能够支持命令行
myapp.exe
< Strike>,我相信您需要类似于 这个答案。更新:
我将其添加到我的一个应用程序中,并且它有效。您不需要注册表项。
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.