I would like to create a Delphi application for Windows XP which allows dropping of files dragged from Windows Explorer (the Desktop or folder windows) or other applications which support this operation (such as Total Commander). What about vice-versa? When the user drags an icon from my application, I should be able to set the contents of the dragged object to custom data.
My goal is to create a custom application toolbar, onto which I can drop applications and show their icons or drag applications or other entities from it.
How can this be done?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
This can be done with The Drag and Drop Component Suite. It also has examples for what you want.
回答2:
Raymond Chen has a nice series of articles about drag&drop:
- What a drag: Dragging a virtual file (HGLOBAL edition)
- What a drag: Dragging a virtual file (IStorage edition)
- What a drag: Dragging a virtual file (IStream edition)
There are many other good articles on his blog when you search for drag and drop.