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?
views:
1430answers:
3This can be done with The Drag and Drop Component Suite. It also has examples for what you want.
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.
DropMaster from Raize Components
DropMaster is a set of 4 native VCL controls for use in Delphi and C++Builder. While the VCL components included with Delphi and C++Builder permit drag and drop between windows in the same application, DropMaster allows developers to add support for drag and drop between applications. The drag and drop can be between the developer's new application and existing applications such as the Microsoft Office suite, a web browser, etc., or between two custom-written applications.
DropMaster's functionality is divided according to whether you want to allow the user to drag from his application to elsewhere, i.e., a drag source, or from elsewhere to his application, i.e., a drop target. In addition to the actual drag and drop functionality, the components expose several events that allow the developer to get feedback on the drag and drop process while it is happening, or to modify it.