DoDragDrop()到Windows 7任务栏

时间:2010-10-16 15:08:21

标签: c# .net drag-and-drop taskbar shortcut

我试图允许从我的程序(winforms)拖放到Windows 7任务栏(固定我的程序),但没有成功。

我做错了什么?

DataObject objData = new DataObject();
objData.SetData(DataFormats.FileDrop, true, new string[] { Application.ExecutablePath });
((Control)sender).DoDragDrop(objData, DragDropEffects.Link);

1 个答案:

答案 0 :(得分:1)

我读了HereHere,其中有条理地将项目固定到任务栏已被故意禁用(由于条形码的垃圾邮件)

我还阅读Here如何使用shell来规避这一点(并且你可以编写执行shell脚本的代码)

现在您只需编写代码来执行脚本

编辑:这是我发现的与您的相关问题密切相关的所有信息。我不能说它会成功,但我已经开始了,这足以让你开始(或者至少足以帮助你找到更多信息)。

A post containing code for drag&drop from application to desktop (from there it should be easy to move onto the taskbar) MSDN information about DataObject (related to drag&drop