如何写入剪贴板以获得“创建快捷方式”? Windows 资源管理器中的选项?
将文件下拉列表放在剪贴板上后 - 在 Windows 资源管理器中右键单击不会给我“创建快捷方式”的选项。我怎样才能得到它?
谢谢。
After putting a filedroplist on the clipboard – right clicking in windows explorer doesn’t give me the option to “create shortcut”. How do I get that?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要存在其他格式,尤其是 OLE 格式。
试验我的应用程序(ClipMate)的诊断模式,我发现当您将文件复制到剪贴板,然后右键单击 Windows 桌面时,将从剪贴板读取以下格式:
然后当您实际执行时“粘贴快捷方式”,拉出附加格式:
我能够在没有首选 DropEffect 的情况下执行“粘贴快捷方式”,所以我认为这是可选的。我在Windows XP、SP3上进行了测试。 YMMV 与其他平台。
You need other formats present, particularly the OLE stuff.
Experimenting with a diagnostic mode of my app (ClipMate), I see that when you have copied a file to the clipboard, and then right-click on the windows desktop, the following formats are read from the clipboard:
And then when you actually perform "paste shortcut", an additional format is pulled:
I was able to perform a "paste shortcut" without the Preferred DropEffect, so I think that's optional. I tested on Windows XP, SP3. YMMV with other platforms.
这不会像你想要的那样工作。当您将文件拖动到计算机上并释放鼠标右键时,不会涉及剪贴板。您可以通过打开记事本,编写一些文本并复制它来测试这一点,然后通过右键单击在计算机上创建快捷方式,最后将文本粘贴回记事本中。当您执行此操作时,您会看到文本仍然存在,这意味着没有文件放置在其“上方”。
因此,您无法对剪贴板执行任何操作来更改“在此处创建快捷方式”的含义。您可以做的最接近的事情是创建一个快捷方式,如 @IAbstract 所说,并将该快捷方式复制到剪贴板。您将能够右键单击并粘贴快捷方式。有关更多信息,请参阅本文拖放删除动态创建的快捷方式
This won't work as you want it to. When you drag a file on your computer and release the right-mouse the clipboard is not involved. You can test this by opening notepad, writing some text and copying it, then create a shortcut on your computer through right-clicking and finally pasting the text back into notepad. When you do this you'll see the text is still there which means no file was place "over" it.
So there's nothing that you can do to the clipboard to change the "create shortcut here" meaning. The closest thing that you can do is to create a shortcut as @IAbstract said and copy that shortcut to the clipboard. The you'll be able to right-click and paste the shortcut. See this article for more Drag & drop of a dynamically created shortcut