There is nothing wrong with your television set. Do not attempt to adjust the picture.
Version 5 has been released.
This version is obsolete.
The Drag and Drop Component Suite is a freeware VCL component library that enables your Delphi and C++Builder applications to support COM based drag and drop and integrate with the Windows clipboard.
The drag and drop system that is built into the VCL, is limited in that it only supports drag and drop within the same application. If you need to drag data from your application to other applications (e.g. Word, Explorer or Outlook), or if you need to be able to accept data dropped from other application (e.g. the Explorer), you have to use COM based drag and drop. COM based drag and drop is an integral and very important part of the Windows user interface and the Drag and Drop Component Suite makes it very easy to leverage all the features of COM based drag and drop in your own Delphi and C++Builder applications.
Every drag and drop operation involves two objects: A drop source and a drop target. The drop source provides the data to be dragged, and the drop target accepts the dragged data.
Likewise there are basically two sets of components in the Drag and Drop Component Suite; Drop source components and drop target components. Most of the source and target components are specialized to handle just one type of data, but a few of the components supports a wider range of data types or are completely generic.
In addition to the drag and drop components, the Drag and Drop Component Suite also includes components that can be used to build Windows Shell Extensions. While these components aren’t all related to Drag and Drop, they benefit from the Drag and Drop Component Suite framework and allow you to write Windows Shell Extensions with very little code. But most important; I had a lot of fun writing them :-).
IDropSource
, IDropTarget
, IDataObject
and IAsyncOperation
interfaces.The Drag and Drop Component Suite contains the following components:
Drop Sources | Drop Targets | |
---|---|---|
|
|
The library includes 19 example applications that demonstrates implementations of the most common drag and drop tasks. Also included are four sample shell extensions.
New in version 4.2 are the following two examples:
This work is licensed under a
Creative Commons Attribution-Share Alike 3.0 Unported License.
D1 | D2 | D3 | D4 | D5 | D6 | D7 | D2005 | D2006 | D2007 | D2009 |
Note: The Drag and Drop Component Suite should be compatible with Delphi 5 and later, but it has only been properly tested with Delphi 5, Delphi 7 and Delphi 2007.
If you can confirm compatibility with any of the untested versions of Delphi (or C++ Builder for that matter), please let me know and I will update the table.
[Updated 2008-05-15] Added D2006 per user feedback.
I have done absolutely no testing with C++ Builder so I don’t know if the code works with it or not. For the same reason I have removed the C++ versions of the examples from this release. If you need them, let me know and I will make them available as a separate download.
That said, according to feedback I have received, the current release should work with at least C++ Builder 5.
Download: | The Drag and Drop Component Suite v4.2 - Complete |
---|---|
Version: | 4.2 |
Updated: | 14 May, 2008 |
Size: | 432.91 KB |
Notes: | Includes component source and demo applications. |
Downloads: | 23,405 |
Download: | The Drag and Drop Component Suite v4.2 - Source |
---|---|
Version: | 4.2 |
Updated: | 14 May, 2008 |
Size: | 119.51 KB |
Notes: | Includes component source only. |
Downloads: | 3,861 |
Download: | The Drag and Drop Component Suite - Hotfix 4.2.20080604 |
---|---|
Version: | 4.2.20080604 |
Updated: | 4 June, 2008 |
Size: | 5.08 KB |
Notes: | Hotfix for the Drag and Drop Component Suite version 4.2 Fixes a memory overwrite bug in TDropFileSource, TDropFileTarget a.o. |
Downloads: | 5,198 |
You might also want to check out the development snapshot.
Packages
folder, find the design time package that matches your version of Delphi. Open it in Delphi, Compile and Install.Library
sub-folder that matches your version of Delphi. Add it to the Delphi library search path.Source
folder to the Delphi browsing path.Drag and Drop Component Suite
design time package.Library
folder from the Delphi library search path.Source
folder from the Delphi browsing path.I realize that some people might prefer a real installer to the zip-file-do-it-yourself method I have chosen here, while others might not trust an installer and just want the damned source code. Let me known what you think.
Which installation method do you favor?
Total Voters: 159
Changes since version 4.1
In short, you can’t.
You must understand that the drag/drop API works the same for all applications that uses it, and the Explorer is just like any other application. The drag/drop API provides a framework that facilitates the interaction between a drop source and the target, but since the drop target can do anything it wants with the data it receives, there is no way to communicate the destiny of the data back to the drop source in a uniform way.
One target may chose to display the dropped data (e.g. notepad), another one to upload it to a web server (e.g. a FTP client), a third to move and rename the file (e.g. the Recycle Bin) and a fourth may chose to copy or move the file (e.g. Explorer).
In my experience there is never any real need to know the destination of a drop to the Explorer. If you find that you do need this, you should rethink your solution. - and feel free to ask for help.
AllowAsyncTransfer
property and the Execute
methods’ Asynchronous
parameter?The Execute
methods Asynchronous
parameter specifies if the source should perform the transfer in a thread.
The AllowAsyncTransfer
property specifies if the drop target is allowed to perform an asynchronous transfer.
The two are completely independent. One does not have priority over the other.
Asynchronous transfer on the source side is an “invention” of mine. It can be done even if the drop target doesn’t support, and thus doesn’t take an active part in, asynchronous transfer.
Asynchronous transfer on the target side is a COM drag/drop feature (see IAsyncOperation
in MSDN). It requires that both the source and the target support asynchronous transfer. All the Drag and Drop Component Suite components support asynchronous transfer, but apart from Windows Explorer few applications has implemented the feature.
An optimized move is simply a move operation where the drop target moves the data from the source to the destination location.
In a conventional move operation, the source and the target must cooperate in order to complete the operation. First the target makes a copy of the data at the desired location. Then, when the target has completed copying the data, it hands control back to the source who then deletes the original data. This procedure can be very inefficient because it requires two simultaneous copies of the data.
With an optimized move, the target handles the entire move operation and signals the source that an optimized move took place upon completion.
The Drag and Drop Component Suite supports Optimized Move on both the source and target side.
Hi. I have some AV in the Drag and drop VCL.
There will be any update soon?
I will probably release a new version when Delphi Tiburon ships. I already have quite a few changes ready, but I need to figure out how to handle deployment. The way I distributed libraries in the past have been way too time consuming.
If you can provide some details on the problem you're having, maybe I can help.
Hi,
Are you planning a Lazarus version of this component? I think a lot of people would find it useful.
Thanks for your answer
As I don't use Lazarus or FreePascal I don't really think it would be feasible for me to provide a Lazarus version of The Drag and Drop Component Suite.
However since the source is freely available, someone with Lazarus experience could make the necessary modifications and, if possible, I could merge them into the main source.
Furthermore it seems that Lazarus has its own drag and drop handling.
I get access violation when I shut down the application.
The
DragFileSource
andDragFileTarget
components are on the main form.When all forms are loaded I link them to a child form:
The AV appears in the
Unregister
function/procedure.What I am doing wrong? How should I initialize this component?
Thanks
I have not been able to reproduce any problems with the scenario you've described.
Where exactly in the
Unregister
method does the AV occur?Can you reproduce the problem in a tiny test application (e.g. just two forms and a drop target component)?
I'm trying to use Drag and Drop Component Suite with BDS 2006. Using the Delphi 7 configuration, I am able to install the components. However, when I try to compile an application, I get the following error:
[C++ Error] Dropsource.hpp(74): E2303 Type name expected
The line referenced is:
Indeed,
_di_IDropSource
is not defined anywhere that I can find.Any ideas on what I can try?
A. Parise
BTW: the components look great.
Please try the version 4.2 snapshot.
I know that I've fixed that particular problem for a BCB5 user, so it probably also works for CB2006.
The installation within Turbo Delphi (based on BDS 2006) worked flawlessly (based on Delphi 11 configuration). I only tested some examples, but they worked out-of-the-box!
Thanks for the feedback. I have updated the table.
hi. Thank you for a very time saving component. Just what I needed.
I use it on a TreeView, where the nodes have the logic for telling if a drop is possible, and what the default should be depending on
ShiftState
. This is called fromOnGetDropEffect
, so it will be used internally byDragEnter
,DragOver
andDrop
. I don’t have anyOnEnter
orOnDragOver
event handler of my own (not anything to do there), justOnDrop
.It works fine, but I don’t allow drop on whitespace or some of the nodes. So if that happens the first time called by the internal
OnEnter
handlerFDataObject
will be set tonil
, which isn't a good idea for me. I commented these two lines out and now it works great.Have I figured this out right or are there anything thats going to bite me back later.
/Peter
I think what you are trying to do could very easily be accomplished with the traditional drag/drop logic as there's nothing unusual about it.
You should use the
OnEnter
event to accept or reject the drop based on the content of the dropped data. E.g. if you only allow files of a certain type to be dropped on your treeview, setDropTarget.GetDataOnEnter
to True and reject the drop inOnEnter
if the file types doesn't match your requirements.In the
DropTarget.OnDragOver
event you can perform hit testing on the treeview and allow, deny or change the drop mode the based on that.Thanks for a great suite!
Could you please explain if possible (can't see in any of your demos) how to drag and drop between 2 shelllist windows in an application? My form has 2 shelllist components, each representing different folders,e.g.
shellist 1: Drive C:\Temp
shellist 2: Drive D:\Temp
Thank you.
First of all, you haven't specified which ShellListview control you are using, but since most, if not all, 3rd party shell controls already support drag/drop I assume you are using the sample ones that come with Delphi (in the
Demos\ShellControls
folder).The
DropFile
unit of the DragDropDemo example that comes with the Drag and Drop Component Suite contains an example of drag/drop with Delphi's sampleTShellListView
control. Although the example is a bit obfuscated by the hack it employs to work without requiring the sample controls to be installed, it should be able to guide you.Hi Anders,
When using your Drop&Drop component, can I still use Delphi's built-in Drop&Drop feature (to drag & drop inside the same app)?
In your SourceDemo app, I can drag from ListView to Explorer. That's fun and great.
But I also want to drag the listview items within the ListView, just to re-order them.
I use the following code to implement drap&drop inside ListView:
DragMode
todmAutomatic
OnDragDrop
event handlerOnDragOver
event handlerIf I add the above code to your SourceDemo, the program doesn't work properly.
Please advise.
Thank you.
Simon La
How do I set about using your suite with BCBuilder?
Thanks
Steve
I have no idea.
Thank you very much Anders!
Your components helped me very much with realizing drag & drop onto my form.
Best regards!
Libor, Czech Republic
I replaced the drag&drop (vcl and COM) in one app with the d&d-suite, works very good
Gerhard
Hi, I am using Groupwise 6.5 and I can drag an email to Explorer or the desktop. It comes across as a .gzw or something like that. If you double click on the file on the desktop it will open in Groupwise.What I want to do it be able to drag selected emails across to a Delphi application and store them there for later retrieval.
Sort of like an imformation application that stores comments, etc in a database but also stores emails sent on a topic.
Could you please point me in the right direction.
Terry
If i drag over a none
TWinControl
child of a registered targetTCustomDropTarget.FindTarget()
fails.Enhancement suggestion:
Thanks, I'll investigate.
If I chose to go with
FindDragTarget()
I will probably allow disabled controls though (i.e.FindDragTarget(p, True)
). I can't see any reason not to.Hi. I´m a Delphi developer and already installed this package in Delphi 2006. I´ll test and soon I´ll give you a feedback. But now I´m starting in the c++ builder - and I´m trying to install it, but I´ve not succeed. Could you help me? I tried this: I started a new package for c++, saved it, and add all the .pas in this package. I´ve succed to install some components this way. Where did I was wrong? I really thank to you for any help.
A colleague figured out how to build 4.2 in C++ Builder 2007. Here are his notes:
designide.bpi
under Requires.designide.bpi
is in\Program Files\CodeGear\RAD Studio\5.0\lib\release\
BCB
as a compiler directiveDesignIDE
{$define DD_WIDESTRINGLIST}
at the bottom ofSource\DragDrop.inc
Just trying to add the source files to an existing bpl project was giving an "Internal error F2084" error message.
Anders,
Are you really licensing the drag and drop component suite under a CC Share Alike license now? Do you realize that anybody using a Share Alike component in their application may have to release the full source code to their application?
The CC SA doesn't explicitly cover this case, but to me it reads that it does make this requirement, similar to the GPL. I certainly won't use Share Alike components.
Would you be willing to license the drag and drop component suite under the MPL or LGPL licenses? Those still require changes to your components to be published as open source, but they explicitly allow your components to be used in closed source applications.
Hmmm, yes; You've got a point.
Here's my retort.
Anders, Delphi 2009 is now available and I'm trying to update an old project (www.bayden.com/slickrun) to compile in the new environment. Do you have an ETA on when your most-excellent component will be compatible with Delphi 2009?
Thanks a ton!
-Eric
Not really, but since next week is a vacation here in Denmark I might have time to give it a go then.
I have used your excellent suite for years now, and am very pleased with it. Your version 4.2 adds Unicode support for Delphi 7 but not, it seems for Delphi 5/6 (since the "class helper for" construct was first introduced in Delphi 7). Do you have an update that solves this, or instructions on modifying your classes to support Unicode in D5/6?
No I'm afraid I will not add further support for Unicode for versions prior to Delphi 2009.
The only reason I have used class helpers is to avoid breaking backward compatibility. If backward compatibility doesn't concern you, you could just derive a new class from TStringList, add the Unicode stuff to this class and use that class in place of my TWideStringList.
Hi Anders,
i have made some small changes for Delphi 2009.
DragDrop.inc
DragDropFile
;Regards Manuel
After the small changes for Delphi 2009, this function fail:function TFixedStreamAdapter.Read(pv: Pointer; cb: Integer; pcbRead: PLongint): HResult;begin if (not FHasSeeked) then Seek(0, STREAM_SEEK_SET, PLargeuint(nil)^); Result := inherited Read(pv, cb, pcbRead);end;
Full ACK.
Hi Anders,
My application has TPageControl and hope I can do the effect like drag the TTabSheet and drop it to desktop same as Google Chrome or Safari. My idea is ask Windows Explorer to execute my exe again with some parameters when I dropping the TTabSheet on desktop. May I have some advice or direction to implement this effect. Any component in the sute can help to do it.
Thanks a lot.
Terrance
Hello
When I drop an Email how Can I exec the SaveAs method from the TMailItem object ?
If not possible, How can i Get the message Id
Thanks, Pascal
I'm afraid you'll have to figure this out for yourself. It's beyond the scope of the Drag and Drop Component Suite.
I am using DragDrop in Delphi 2007. I encounter memory leak. Please try the following console application:
program Project3;
uses
DragDrop;
begin
ReportMemoryLeaksOnShutDown := True;
end.
Known, harmless (it's a one time leak) and fixed in V5.
This package is very very good ! so thanks for your effert !.
But…
I think this is bugs….
How about test serveral time drag and drop on child window ?
I tested all the times. but will happen each time.
on Child window. drag and drop from desktop or folder to child window.
drag and drop OK ! but when i close child window and re open …
and then close will happen error.
Please check DragDropDemo.exe.
Thanks for reading.
Is this just for me ?
Can't reproduce. Sorry.
how can I drag "my computer","IE","recycle bin" to the application,and identify them?
See .\Demos\PIDLDemo for examples of #1 and #3.
Greetings,
Just downloaded your latest version of DnD, opened the D5 package, compiled and when I click the installed button, I get an error "Cannot load package 'DragDropD5'. It contains unit 'DragDrop' which is also contianed in package EQpack1_D5" This is of course is part of a very old EQ Delphi Pack 1 by Peter Thornquist (I think) and I use a few of the components from this component set, but not the Drag and Drop component. Any suggestions on what I could do?
Thanks
Work fine in Delphi 2005 Win32. I used D7 dpk. Thanks.
How to install your component to C++ Builder?
Thanks.
graphman@tlt.ru
I don't know.
Hi,I downloaded your last version of "Drag And Drop Component Suite".
I need to create an application that accepts drops from outlook and save them as msg in a blob fields so I can reopen them later with outlook.
I started from your outlook example, but I had to change it because of different requirements.
I try to use TDataStreamDataFormat, but the streams are always empty!.
I try to use TVirtualFileStreamDataFormat (within your VirtualFileStream example), but I always get empty streams.
NOTE: With these two techniques other file types work, for example I can successfully drag a zip file from within an outlook mail to my application.
Using your SourceAnalyzer I see that "Outlook's drags" export an Empty FileContents format (IStorage and IStream), but with other types I get fully-readable IStream objects in FileContents.
I know this is due to Outlook and not to "Drag And Drop Component Suite", but maybe you know this issue and the right workaround.
Do you?
Thank you in advance.
I have reproduced the problem and it turned out to be a problem with FileContents clipboard format in an IStorage medium.
I believe I have fixed the problem. Please try the next V5 snapshot when it becomes available.
I tried: It's OK!
Any plan to upgrade Drag and Drop Component Suite to Delphi 2009?
Sure; Lots of plans - no time.
It should be available within a week.
Do you support Drag Drop Component Suite für Delphi 2009?
Please, can you tell me when will the next V5 snapshot become available?
Is there a way to download a beta-version?
Thank you.
RSN… I've just fixed the last known problem.
Hi,
this is another problem with outlook target(Outlook 2003) in OutlookDemo.
Put a button for Paste operation and process the click event:
DropEmptyTarget1.PasteFromClipboard;
Run the program.
After the first clipboard operation the program ignores all other pasted content from outlook. Drag and drop works well.
I have the same problem in an application of mine derived from this example.
Thank you in advance.
Reproduced with the demo.
It works if I paste one item, copy another in Outlook and then paste again.
It breaks if I paste one item, clear in the demo, copy another in Outlook and then paste again.
I'll investigate, but it has to wait until after the next snapshot release. It's delayed enough as it is.
We're in trouble with a customer for these problems, so we cannot wait.
Is there a way to obtain a patch (for 4.2) or something similar?
We know this software is free, but we could pay a something to obtain special support.
What can you tell us?
Please let us know something ASAP.
Thank you.
I'm sure we can work something out.
I have contacted you by email.
I tried with V5 snapshot.
It seems ok.
Thank you.
Hi Anders, firstly thank you too much for this package because it a like life-saver
I've downloaded the last release and try to run SimpleSourceDemo (and some other demos), but program is stopped and error on Codegear's
StdActns.pas
file and it pointed that the line ofTBrowseForFolder.ExecuteTarget(Target: TObject);
procedure with(code is :
pszDisplayName := @DisplayName;
), and if i cancel this error with "//
" then run it again then(line:
lpfn := @BrowseCallbackProc;
) if i cancel this line too then many other errors..What can be the solution of these problems…
Thanks right now..
Sorry for insufficient information..
1. I am using Delphi2007
2. Drag and Drop Component Suite Version 4.2
3. Yes i configured library path variables.
I addition, i don't change any code in the samples, just try to run but when i press run button then these errors occur.
But interesting, if i put your components on a new form and try to run then everything is ok without any errors..
Re #3: I didn't ask if you did configure your library path. I asked why you put the VCL source directories in it. Anyhow, I actually don't care why, but here's why you shouldn't do it:
I believe this problem (which isn't a bug) is caused by two things:
Unless you have modified the VCL source I can see no reason whatsoever to do that.
The combination of these two causes the VCL to be recompiled with some settings that it wasn't designed for.
sorry, i have some problem with english, i've misunderstood…
i've installed it with same steps in installation procedure (readme file), and i think that maybe i did some mistakes then reinstall (after uninstall everything) but the same problem occurs, i've controled for inc file but there is no. In addition, as i mentioned before if i take the codes and make same one of your demo(eg. TargetDemo) then there is no problem and it works perfectly.. Anything else, i just wanted to warn you about is there any problem but it looks no problem (i think). Thanks for your support and spent time..
As a result, this package is perfect and thank you for share it with us..
Is there support for Delphi 2009?
Yes, in version 5.
First of all thanks for your component pack. I have had good use of it so far, but now I am upgrading to RAD Studio 2009.
Are you planning any update within near future, or should we try to figure out how to do this on our own?
I've released a snapshot of the next version which supports Delphi 2009. You should try that.
Dear Anders,
Thank you for this wonderful program. I am testing now the version from 8th Feb. 2009, including the two hotfixes. Everything installs ok. But I need a functionality for a program, where it is possible like in your program example
SimpleTargetDemo to drag and drop from explorer files, but with "real" unicode
names, like Czech names.
Your demo produces the following result, I give a link to a screenshot:
http://www.winserion.org/DragDrop01.png
I do not know, where the problem is, because I tested with Delphi2009 and every string should be unicode.
Sincerely
Peter
Peter,
The problem is that you are using a font that doesn't contain the required glyphs/characters.
The demo you tried was originally created back when MS Sans Serif was the default font. A more modern choice would be the MS Shell Dlg, MS Shell Dlg 2 or Default font substitutions. I'll try to remember to update the demos with this. I have now updated all demos to use MS Shell Dlg 2.
If you want to be able to support every possible language, then I'm afraid you'll have to use a font which support them all. Few do. The application in the screen shot uses Arial Unicode MS.
Here's a few relevant links:
Hi, I've been trying to permit drag n drops into one of my Delphi application for weeks.This morning I found out about Drag and Drop Component Suite v.4.2. So I downloaded it and I've tried to use it, 'cause it seems to do exactly what I've been trying to do…
The only problem is that I need to be able to drop either windows files and outlook mail (and soon hotmail and gmail too) in the same listview….
I've tried to "mix" two different methods of your packages, and it's not working at all, any idea on how I would be able to do this?
thanks Mahel
There are several ways to solve your problem, but I suggest you start by looking at two of the demo applications (in this order):
This application demonstrates how to extend one of the drop target components with support for additional data formats.
This application demonstrate how to receive and process data dropped from Outlook.You'll notice that both applications use a
TDataFormatAdapter
component to add support for new data formats.Now in order to get simultaneous support for both the Outlook data and regular filename data, I suggest you just extend the OutlookDemo application with support for filenames. This is most easily done by replacing the
TDropEmptyTarget
component with aTDropFileTarget
component, but you can also use an additionalTDataFormatAdapter
component with theDataFormatName
property set toTFileDataFormat
if that suits you better.With regard to Hotmail and Gmail you can probably use an additional
TDataFormatAdapter
with theTURLDataFormat
class.Edit: It’s probably best if you try all this with the v5.0 snapshot since it has some bug fixes that are relevant to Outlook drag/drop
Hi Anders! Thanks for your answer, it worked just great! Now, i've something elese to ask you; Now that I can drag and drop either windows file and outlook mail. I found out a way of "copying" the mail i dropped into my TEMP folder…i'm trying to also copy the attached files at the same place…i know i can retreive the number of attached, their name, size etc. But i coudn't find a way to save them at the same place…
Any clue?
Thanks again for your great component, it made me save so much time!!
Mahel
Again, see
OutlookDemo
for an example of how to extract attachments from a message and save them as external files. It's in theActionAttachmentOpenExecute
method of theOutlookTarget
unit.I just want to thank you for your excellent component pack and say that using v.4.2 (with Delphi7) and based on your demos, i managed just in 30 minutes to intergrate in my software the capability of storing files and outlook messages that the user drags and drops on a form inside my application's database.
Thanks Again
A.Kyriakos
Athens, Greece
Hi Anders !
I'd love to have access to the C++ examples. I've been using the DragAndDrop components in BCB5 for many years now and I've now updated to version 4.2 and have some new needs (the Asynchronous Source with File Stream example seems to be exactly what I'm looking for
Cheers !
/Tias
> I've been using the DragAndDrop components in BCB5 for many years
How have you installed this component to Borland C++ Builder?
I'm not sure that I still have the C++ demos, but I'll look. I'm certain I don't have a C++ version of the AsyncFTPClient demo though, as that was written after I stopped maintaining the C++ demos.
Hi, first of all THANK YOU for your great work, for the great support and for keeping quality software free.
I am writing a program with a friend (non commercial, and we will give proper credit) but we were not able until now to implement one of the many features.
We would like to know if, using this component, is in theory at least possible to "simulate" a "drop" of an image into another running application.
What we are trying to do is, by pressing a button in a Delphi application, we need to "simulate" a dropping of an image in another non-Delphi application (and of which we have no sources) which is running together with our program.
Can it be done? Thank you!
I'm afraid there no (sane) way to do what you ask.
Theoretically it should be possible to hack into Windows' internal drag/drop structures and even to locate the desired drop target although you'd have to cross process boundaries, but the solution would be so complex and fragile that I won't even consider doing it just for the heck of it.
That said, if the "other" application can grab the image from the clipboard, then you could have your application place the image on the clipboard and then inject a paste key sequence (e.g. Ctrl+V) into the other application. Don't ask me how though.
Hi Graphman !
It's quite simple. This works in BCB 5 Pro :
1: Create a new Design & Runtime package in BCB.
2: Include all the .pas file in Anders' package.
3: Click Install to compile & install it.
That's it.
Cheers !
/Mathias
Any reason why this shouldn't work?
Drag an outlook item (stored as msg file) from Delphi application:
Nice try, but unfortunately there are several reasons:
TOutlookDataFormat
only support the FileContents format.TOutlookDataFormat
was only designed to read data from Outlook, not to write data to it.TFileContentsStorageClipboardFormat
, which is used internally byTOutlookDataFormat
, only support reading data.The good news is that I've solved problem 1, 2 and 3 which is enough to get Outlook to accept the drop - and fail with an error message (Can't copy the items). Now I'm working on solving problem 4, but I doubt I will get it done tonight. It's been a long day.
By the way, why don't you just use
TDropFileSource
if you already have the Outlook message in a file?Problem 4 turned out to be easier than I thought. I have it working now.
I will upload the modified source ASAP. Let me know if you want me to mail them to you now.
Wow, impressive! I'm very curious now to see what you have done Thanks a million for taking the time to look at it!
HI,I want to get bcb examples.
Can you send me a link?
first off, great component
second, using your outlook message sample, it works great in every computer in the office except mine. when i drag a message to the application it gives me the error "the operation failed because of network or other communication problems. verify your connections and try again"
curious if you have run across this.
HI Anders, It's me again.
I've been using your component for a certain time now, and as I tough, our client wants to be able to drag n drop message from Outlook Express(on XP) and Windows Mail (on Vista). I've tryied some tests to be able to drag n drop either win files and outlook message using DropComboTarget and it seems to work fine but how can i retreive OutlookExpresse message?
Thanks for your good work!
By the way, when i also used the Outlook.ActiveExplorer.Selection;
and the MailItem.SaveAs. That way i save the message as it is without bothering about its format, attachement etc. I tough i would be able to do the same with Outlook express but apparently, microsoft did not provided an interface to do so….
thanks again
Mahel
It seems that there is a typo in the file "DragDropText.pas".
In this file, 6 times the type TFileGroupDescritorClipboardFormat (yes, "Descritor" without the "p") is used, which should be TFileGroupDescriptorClipboardFormat (with "p", as defined in DragDropFile.pas).
It doesn't cause an error because DROPSOURCE_TEXTSCRAP is not defined at the top of the file, I just wanted to mention it in case that define will be used by someone.
Holgerwa
Hi! Is there any way somebody could upload “corrected” an »Outlook« example that would enable to drag&drop Outlook email msg-files to demo application (I want to save Outlook emails in my database as .msg files). I need it really urgently and any help would be really appreciated.Thank you and best regards,Smiljan
HI! I'm not sure of what you mean by "Corrected". I did use the "Outlook" demo just to give the apperance of the dragging and i also used the micrsoft interface to get what was dragged..
something like this…
hi..
can i get drag target directory name?
when I drag from tlistview to exploer , I want know exploer directory name.
Please read the FAQ.
If I use your components for commercial product, should we pay for them?
Like it says in the first sentence on this page: It's freeware. You don't have to pay.
When I drop the
TDropDummy
on a form, I get an AV. I am using V5 with Delphi 2007.What I want to do is to drag and drop files from a treeview to explorer…
I have not been able to reproduce your problem with V5 and Delphi 2007. A few questions:
TDropDummy
on a new empty form or only on a specific form?To drop files from a treeview in your application to explorer you should use a
TDropFileSource
component.TDropDummy
is only used to enable drag images to be displayed over controls that are not drop targets. You could get the samme effect with the following code:I was working with the Outlook. Are there any versions (other than Express) that the Outlook will not work with? Or are there any version issues that anyone knows of working with the Drag and Drop? I do want to say that what I've worked with so far has been outstanding, definately takes a complicated process and simplifies it.
To my knowledge there are no problems with different versions of Outlook due to the fact that I only use the published Outlook API/MAPI contrary to "those other drag/drop components". Just make sure you use the V5 snapshot since it fixes a few bugs that affect Outlook drag/drop.
I'm a begginer programer and I would like to save outlook msg file without show me a "Outlook-security dialog", now I use MailItem.SaveAs('name.msg'), are there another way to save dropped file to a msg without prompt dialog?
Best regards,
Pere
Can't help you with that. Sorry.
Try asking in one of the newsgroups that deals with Office or Outlook automation.
I'm working with the component using it as a target for e-mail messages being dropped from Outlook. I'm having a problem with the following line:
This line will work if I'm passing in a
PT_TSTRING
. But if I'm passing in aPT_SYSTIME
, it fails out on me. Basically, I'm just trying to grab the date information from the e-mail. I can see it if I display the header, so I know it's there, but I can't get it to just return that date information to me.Your help is appreciated. Thank you!
I can't help with Outlook stuff.
Try asking in one of the newsgroups that deals with Office or Outlook automation.
Thank you for a great job!
I would like to automate the Drag-drop process e.g. no user should not have to manualy perform the process, but rather my application should in pure code be able to "drop" a file on another program window.
(Let´s say that the other program is an image viewer and the delphi program should every ten second "drop" on it a new image file to be displayed like a slide show, and the other program responding as if a user had manually dropped each file on it.)
Is it possible with this suite?
No, it's not possible with the Drag and Drop Component Suite.
In order to emulate a drag/drop operation you will have to use the old WM_DROPFILES message. Not all application will support it and some, like Explorer, might require additional hacks to make it work.
I haven't tried it but I would think something like the following would work:
hi,I'm a programmer from China.I have used your Drag and Drop Component and it helped me a lot.Recently I have a trouble in dropping two or more files whose name have Chinese characters from my Delphi window to Windows Explorer,the explorer can only reiceve the first files.I had tried to resolve the problem by reading your source code for several hours, but I can't do it.If you have an idea about it,please mail to 124596885@qq.com, thanks.
Hello. Your toolkit looks very good. I have a question. Would there be a way to drop a file from my application to the target in which the file being dropped could be rendered by the source at the time it is dropped? In other words, it seems that the TFileDropSource object requires that files already exist at the full size before dragging and then dropping. I'm looking for a way that the source app could render the file at the time of the drop itself. Is that something that would be possible to do? (Reason I ask: I'm looking for the user in my application to be able to select a section of audio data, and then click on the section and drag and drop the mouse to the target app, and at the time of the drop, my app would render a .WAV file for the target app to receive)Thanks,Jeff
I suggest you make use of the FileGroupDescriptor and FileContents cliboard formats. The FileGroupDescriptor format should contain the filename(s) and the FileContents format your WAV data. The data does not have to exist physically on disc.
See the
VirtualFile
andVirtualFileStream
examples.The
ExtractDemo
example is also a possibility but it uses another approach.The approach used in the ExtractDemo looks like it should work fine.
Thanks.
Hello,
Thanks a lot for the excellent components!!!
I've got a question on ExtractDemo example:
while extracting the huge file an application hangs i.e it is impossible to
control the form, and by attampting to write DropFileSource1.Execute(True)
as it is given at syncSource examples a message "Error" appeared. How can I
avoid the problem?Best Regards,
Evgeniy Shiyanov
Jeg tillader mig at skrive på dansk
I din demo “sourceanalyzer”, metode ActionSaveExecute har du et par konstantstrenge. Disse skal IKKE ende med #13. Ellers har output 13,13,10 som linieskift og det giver lidt knas efterfølgende.
Ellers var sourceanalyzer lige hvad jeg var ude efter. Tak.
Hello!Thanks for your great component!We're writing a test program based on your outlook demo. Everything works fine, except we cannot get the mail's date of arrival when we drag it to our application.Can you help on this?Thanks!Peter
I can't help with Outlook stuff.
Try asking in one of the newsgroups that deals with Office or Outlook automation.
Thank You, Anders. Great components. I am try install Your 5 snapshot into Builder 2009 on Your instruction. (embarcadero.public.cppbuilder.vcl.components.using)
Component installed - ok But, if i am make small example, I have many errors in .HPP files: [BCC32 Error] Dragdropcomobj.hpp(28): E2303 Type name expected [BCC32 Error] Dragdropcomobj.hpp(48): E2312 'TVCLComObject::TComObject' is not an unambiguous base class of 'TVCLComObject' [BCC32 Error] Dragdropcomobj.hpp(76): E2356 Type mismatch in redeclaration of 'TVCLComObject' …….. …….. Path to Include-files exists in a project Not prompt me, how to decide a problem ? Dmitry.
Hi, tried to compile DragDropD11.dpk in Delphi32 2009. Could not be compiled because of 7 fatal errors:
As the requirements above clearly state version 4.x does not support Delphi 2009. Use the version 5 snapshot instead,
Does anyone have an example of how to detect and handle rich text dropped on a target?
Thanks
Jim
Here you go:
http://melander.dk/download/DragDropRtfTarget.zip
Note that this demo was written with the Version 5 snapshot.
Enjoy!
Thanks for the rich text example, that is exactly what I was looking for.
Jim
Hej Anders
I have been checking out your Drag and drop component Suite for Delphi because I am looking for a solution to my problem which is: how can I drag an Outlook item onto my application and save it as a file? My problem is converting the dragged item to a .msg file. Can your suite solve this for me?
Kaerlig hilsen fra Island,
Kristjan
Yes. The components themselves can handle the drag/drop part of your problem.
WRT to saving the dropped message as a .msg file please see the OutlookTarget demo application. At the moment the demo "just" displays the properties of an
IMessage
object, but with a bit of research you yourself should be able to add the functionality required to also save this object. I've already implemented the feature for inclusion in the next release. On a related note, the next release will also include a demo of how to drag messages to Outlook.P.S. I suggest you use version 5 for this as it contains some fixes and improvement that are relevant for drag/drop of Outlook items.
P.P.S. I've moved your comment from the About page to the DragDrop page.
Hi Anders,
I am approaching you in connection with the excellent Drag-and-Drop Components Suite that you originally made with Angus Johnson. I am using this suite v 4.2 with Delphi 5 and it works smoothly and very well.
What I specifically appreciated in this suite was that using drag-and-drop to “transfer” login data from my application to web sites was a successful way to bypass whatever keylogger or clipboard loggers, specifically when using PCs at uncontrolled public places. It was my opinion that this was the safest way how to enter the loging data without the risk of it being intercepted by some logger(s).
Recently, I have come across a small utility called TTEOAK which can show intercepted areas when using a PC - keys pressed, clipboard contents and screen snapshot made. In addition to this, under menu “View | What Smart Loggers See…” it can optionally display contents of the area by what you mouse over. I was appalled to find out that information that I regarded as safe and confidential when using drag-and-drop was so easily intercepted by this feature breaking apart my illusions that my chosen way of entering the login data was somehow safer.
My question is this. Can something be done so that the D-and-D components could shield their data from such logging? I am sure that this issue by its nature concerns many, many users as D-and-D is mostly seen as the safest way to transfer data. I hope a workaround could be found to protect the dragged data until it reaches its destination and is dropped there. This would be a major improvement of the components suite as security of data is more and more important…
Thanks for possibly looking into this issue.
Kind regards,
David
@David: Using Drag/Drop to attempt to secure credentials in this way is ultimately not very secure. It is trivial to write browser extensions for IE/Firefox that will grab the data directly out of the password prompts and/or the network stack.
Similarly, it is trivial to write packet filters or otherwise rootkit the Operating System to accomplish the same task.
You may find this paper interesting: How To Login From an Internet Café Without Worrying About Keyloggers
David,
First of all, my virus scanner (Symantec) ate the copy of TTEOAK you sent me - which is fine by me because I would never run an application sent to me by someone I don't know.
Secondly I doubt that very many of my users, or even the end users, are concerned by this problem. After all it is a problem that is common to all applications using drag/drop.
Finally, IMO, if you need to protect yourself against a keylogger then you have already lost the battle. If a rogue application can intercept the keyboard, mouse, screen etc, then it practically owns your machine (see rootkit) and can circumvent whatever clever scheme you try to use for data transfer.
Now, with regard to the technical aspects of your problem, I'm afraid it's beyond the scope of the drag/drop components. The components are basically a wrapper around the Windows COM based drag/drop API. Nothing I can do in the components will change how the data is handled inside Windows or the target application.
Sorry.
I'm pleased to announce the release of version 5 of the Drag and Drop Component Suite.
I'm now closing comments on this page.