GithubHelp home page GithubHelp logo

landrix / the-drag-and-drop-component-suite-for-delphi Goto Github PK

View Code? Open in Web Editor NEW
156.0 37.0 55.0 7.37 MB

License: MIT License

Pascal 99.79% Batchfile 0.21%
delphi drop-components drag drop-targets drop-source drop-handler drag-and-drop drag-drop

the-drag-and-drop-component-suite-for-delphi's Introduction

The Drag and Drop Component Suite for Delphi

This component suite based on The Drag and Drop Component Suite for Delphi from Anders Melander
http://melander.dk/delphi/dragdrop

The Drag and Drop Component Suite Version 5.84 Released 11-nov-2023

© 1997-2010 Anders Melander
© 2011-2023 Sven Harazim

https://github.com/landrix/The-Drag-and-Drop-Component-Suite-for-Delphi

Description

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 :-).

Table of Contents

  1. Supported platforms
  2. Installation
  3. Uninstallation
  4. Known problems

1. Supported platforms

This version of the library has been tested with Delphi 6, Delphi 7, Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8 (Win32,Win64), Delphi 10 Seattle (Win32,Win64), Delphi 10.1 Berlin (Win32,Win64),Delphi 10.2 Tokyo (Win32,Win64), Delphi 10.3 Rio (Win32,Win64), Delphi 10.4 Sydney (Win32,Win64), Delphi 11, Delphi 12

2. Installation

  1. If you are using a previous version of the Drag and Drop Component Suite, uninstall that version first.

  2. Unzip the package to a folder of your choice.

  3. In the Packages folder, find the design time package that matches your version of Delphi. Open it in Delphi, Compile and Install.

  4. Locate the Library sub-folder that matches your version of Delphi. Add it to the Delphi library search path.

  5. Optional: Add the Source folder to the Delphi browsing path.

3. Uninstallation

  1. Open Delphi and uninstall the Drag and Drop Component Suite design time package.

  2. Remove the Library folder from the Delphi library search path.

  3. Remove the Source folder from the Delphi browsing path.

  4. Locate the folder where you installed The Drag and Drop Component Suite and delete that folder.

4. Known problems

  • When the demo applications are compiled with Delphi 7, some of them will probably emit a lot of "Unsafe type", "Unsafe code" etc. warnings. This doesn't mean that there's anything wrong with the demos. It just means that Borland, at that time, wanted you to know that they were moving to .NET and would like you to do the same (so you can buy the next version of Delphi). You can turn the warnings of in the project options.

  • Delphi's and C++Builder's HWND and THandle types are not compatible. For this reason it might be nescessary to cast C++Builder's HWND values to Delphi's THandle type when a HWND is passed to a function. E.g.:

if (DragDetectPlus(reinterpret_cast<THandle>(Handle), Point(X, Y))) {
  ...
}
  • Virtual File Stream formats can only be pasted from the clipboard with live data (i.e. FlushClipboard/OleFlushClipboard hasn't been called on the data source). This problem affects TFileContentsStreamOnDemandClipboardFormat and the VirtualFileStream demo.
    This is believed to be a bug in the Windows clipboard and a work around hasn't been found yet.

  • When TDropFileTarget.GetDataOnEnter is set to True, the component doesn't work with WinZip.
    Although the file names are received correctly by TDropFileTarget, WinZip doesn't extract the files and the files thus can't be copied/moved. This is caused by a quirk in WinZip; Apparently WinZip doesn't like IDataObject.GetData to be called before IDropTarget.Drop is called.

About

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 :-).

Features

  • Freeware with full source code included.
  • Enables COM drag-and-drop of any kind of data between applications.
  • Copy, Move and Link operations.
  • Clipboard Copy, Cut and Paste support.
  • Support and implement advanced features such as Delete-on-paste and Optimized Move.
  • Drag image support.
  • Supports both Ansi and Unicode data formats, regardless of the version of Delphi used.
  • Supports asynchronous transfer. Both on the source and target side.
  • Automatic scrolling of the target window during the drag operation.
  • Relatively simple to derive custom drag-and-drop components to support other data formats.
  • Extensive, context sensitive help file and detailed demo applications.
  • Implements the IDropSource, IDropTarget, IDataObject and IAsyncOperation interfaces.
  • Compatible with Delphi 5 through Delphi 2010.

Components

The Drag and Drop Component Suite contains the following components:

Drop Sources

  • TDropFileSource Enables you to drag files and shortcuts from your application to other applications.
  • TDropTextSource Enables you to drag text from your application to other applications.
  • TDropBMPSource Enables you to drag bitmaps from your application to other applications.
  • TDropURLSource Enables you to drag URLs from your application to other applications.
  • TDropPIDLSource Enables you to drag PIDLs (files, folders, shell objects) from your application to other applications.
  • TDropEmptySource A basic drop source component that does not support any data formats on its own. Can be extended with support for any data format through the use of a TDataFormatAdapter component.

Drop Targets

  • TDropFileTarget Enables your application to accept files and shortcuts dropped on it from other applications.
  • TDropTextTarget Enables your application to accept text dropped on it from other applications.
  • TDropBMPTarget Enables your application to accept bitmaps dropped on it from other applications.
  • TDropMetaFileTarget Enables your application to accept meta files dropped on it from other applications.
  • TDropURLTarget Enables your application to accept URLs dropped on it from other applications.
  • TDropComboTarget Enables your application to accept files, shortcuts, text, URLs, meta files, and bitmaps dropped on it from other applications. The component is basically all the above components rolled into one.
  • TDropImageTarget Enables your application to accept meta files, and bitmaps dropped on it from other applications. The component is basically the TDropBMPTarget and the TDropMetaFileTarget components rolled into one.
  • TDropPIDLTarget Enables your application to accept PIDLs (files, folder, shell objects) dropped on it from other applications.
  • TDropEmptyTarget A basic drop target component that does not support any data formats on its own. Can be extended with support for any data format through the use of a TDataFormatAdapter component.

Shell Extensions

  • TDropHandler Implements the necessary interfaces required to build Drop Handler shell extensions. A Drop Handler shell extension is used to turn file classes (e.g. all files with a specific extension) into drop targets.
  • TDragDropHandler Implements the necessary interfaces required to build DragDrop Handler shell extensions. A Drop Handler shell extension is used to extend the popup menu which is displayed by the shell when a file is dragged with the right mouse button.
  • TDropContextMenu Implements the necessary interfaces required to build Context Menu Handler shell extensions. A Context Menu Handler is used to extend the shell popup menu which is displayed when a file is right-clicked.

Additional

  • TDataFormatAdapter Used to extends source or target components with support for arbitrary clipboard formats.
  • TDropDummy Helper component used to display drag images.

Delphinus-Support

the-drag-and-drop-component-suite-for-delphi's People

Contributors

ccy avatar dr-consit avatar javierustk avatar landrix avatar magnussandberg avatar mkinzler avatar philipp-h avatar tommiprami avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

the-drag-and-drop-component-suite-for-delphi's Issues

Outlook demo missing critical statement

The demo The-Drag-and-Drop-Component-Suite-for-Delphi-master\DemosWithoutInstall\Outlook

doesn't work.

As far as I can see it requires the line

DataFormatAdapterOutlook.enabled := true;
adding to the end of
procedure TFormOutlookTarget.FormCreate(Sender: TObject);
in OutlookTarget.pas

That said, I still can't get the demo to grab data from Outlook, but it get's significantly further now.

Cannot install on Delphi 10 Seattle Update 1

Hi, when installing this component from ide on Delphi 10 Seattle update 1 i get this error:

"Can't load package C:\Library\DX10S\Win32_Release\dclDragDropDR10S.bpl. The specified module could not be found."

I verified that the file exists. How can i fix it?

Outlook demo not working on win64

I am running outlook in 64 bit and I have compiled the outlook demo in 64 bit (Delphi 10.4). When I try and drag an email into the app it is not accepted and the cursor icon never changes from the barred icon.

readme.md outdated

You might want to read through the readme.md file again. It contains some outdated information, e.g. "Compatible with Delphi 5 through Delphi 2010".
Also it should say "turn off" rather than "turn of" (for the unsafe warnings in Delphi 7 (why not disable these warnings in the code?)

Memory Leak when uses list included the EmbeddedWB control

We use Eurekalog and have discovered a memory leak when using the DropComboTarget component and a file is dragged into say a listbox and the uses list of the form includes the EmbeddedWB open source web browser control. When the EmbeddedWB unit is not included no memory leak occurs so I am guessing there is some issue when using them together...maybe something related to OLE and COM?

eurekalog.txt

Change in DragDropFormats.pas = aMedium.Stm:=Stream = problems

Hi,

before i was able to perform a DragDrop Operation fromtDropEmptySource (connected to VirtualDataformatAdapter) to tDropComboTarget (new form on same app), after changing lines 1297 and 1303 from iStream(aMedium.stm):=Stream to aMedium.Stm:=Stream it does not work any more.

Changing those lines back ... and everything is working again.

Error installing in Delphi 7

1: res file does not exist, it is recreated by delphy 7.
2: there is no.cfg file
3: when compiling Delphi 7 says that ULONG_PTR is undefined

Outlook demo works only in IDE

I'm using D7, Win7, MS Outlook (MS Office 2010 version 14.0.7015.1000).
In IDE works good, but when i run EXE - there is no any reaction on dragging message from Outlook
The same situation on Win XP.
It's very strange because some time ago it works without any problem. Could you tell me how your component works or any other info to get out of this situation.

P.S. Maybe it happens after one of updates of MS Office.

madExcept Error

I'm using the latest dragdrop files in Rio 10.3. I can set up a simple app with a tmemo and a combo drop target, setting the target to memo1. I can drag and drop a file no problem. However, if I have madExcept running reporting leaks, I keep getting 2 errors. One is type TFixedStreamAdapter and the second is GlobalAlloc. I'll put in a screenshot below. I'm not getting any delphi errors.

If I don't have madExcept reporting leaks in the project, there are no delphi errors reported and it all appears to run correctly.

Any ideas appreciated!

image

How to Combine VCL DragDrop with DropSourceURL?

I've got a VCL based App which used a lot of internal drag and drop functionality. How would I combine that, with the ability to drag items outside the App, using the DropSourceURL component?

I don't seem to find a demo which can perform both drag and drop functionality at the same time. Can you help of give me a pointer?

Set Source files after DropEmptySource.Execute

I'm looking at the AsyncFTPClient sample, it's great!

on that sample, when you drag a file from the ftp, you have to wait a little before seeing any visual feedback on the mouse; this because the AddSourceFile (line 319) asks the FTP for file properties.

I'd love to have istant-visual feedback on the mouse (so i can also think to let the user drag ftp folders, i have more time to fetch files inside), and i was thinking i can do this:

  • When the user drags something i add a single fake dummy file instead real ones
  • Do the DropEmptySource1.Execute (line 328) so i can let the user drop where he wants
  • Adding a FTP fetch procedure at the beginning of OnGetStream function (line 379) that removes the dummy file from TVirtualFileStreamDataFormat(DataFormatAdapterSource.DataFormat) and adds all the real files from FTP.

i made some tests, but looks like every file i add inside the OnGetStream procedure is totally ignored from Windows Explorer, who just want to copy the dummy file.

Is there any way to reach my goal?

Unresolved external in C++Builder project under RAD Studio 10.2

I get the following error, when I try using a DragDrop component in a C++Builder project under RAD Studio 10.2:

[ilink32 Error] Error: Unresolved external '' referenced from C:\USERS\PUBLIC\DOCUMENTS\EMBARCADERO\STUDIO\19.0\DCP\DRAGDROPDR102T.LIB|DragDropPIDL

The error does not happen in Delphi projects.

Could you give me any directions how can I fix this?

Can't Install XE7 Package (it builds though)

Hi, for some reason I am able to build both the DragDropDXE7.bpl and dclDragDropDXE7.bpl packages but when I attempt to 'Install' the latter I get an error saying 'Can't load package, specified module not found' referring to C:\Users\Public\Documents\Embarcadero\Studio\15.0\Bpl\dclDragDropDXE7.bpl (which does exist in that location).

Both of these BPL files compile successfully with no problem, it just fails at the point of installing. I tried going through 'Component->Install Packages' then choosing 'Add' and selecting the 'dclDragDropDXE7.bpl' file but that results in exactly the same error. I guess there must be some path setting not quite right in the project but I can't see anything obvious. Any ideas please because I would really love to be able to use this awesome component set in Delphi XE7 like I did in XE2... Thanks.

Doesn't work when running in IDE and requires mouse over window caption?

I am working with the SimpleTargetDemo (in the installation's Demos\TargetDemo folder) and didn't think it was working at all. Come to find out it will not work when running in the IDE.

I also found that when I did finally get it to work (both in the Demo and in my own little test app) outside the IDE/debugger, it would only work if I first roll the cursor over the window caption. Only then would the application accept the files to be dropped from Windows Explorer. I thought it may be a timing issue but doesn't appear to be.

Is this by design or what would be causing this?

I am running Delphi XE7 with the latest subscription update applied (Dec 2015) on a Windows 8.1 machine.

I would like to be able to use this component but having to roll over the caption first is not an acceptable behavior.

Unable to install in Rio 10.3.1

After compiling, I am trying to install the package, and keep getting the error
that it cannot find a package in the folder.
Everything is there, so I don't know what else it's looking for.

Problem with D&D in W7P 64b (VMware)

Hello, I'm quite sure thats not a Component issue, because it works fine for me under w10 (non VMware).
But with this configuration (see title) I'm not able to perform drag&drop. I'm using your demo 'SimpleTarget' (but its general behavior) and when I drag file (from explorer) then I can't drop them to the form just because its disabled ... Icon disabled as well (you know, the crossed circle). I spend half day but I can't find the solution.
Note: The SimpleTargetDemo is not using elevated privileges.

thanks in advice, Ondrej

Improve installation instructions

Can you provide more detail on how to install this?

After browsing the package folder and opening the package for my version (XE8) in rad studio I can compile or build by right-clicking on the project in the project manager.

But how do I install? There is no install option on the right click menu.
Is there some other trick to installing this?

I probably should know how to do this but I don't. Which is why i'm asking if the instructions could include more detail.

GetIt Package Manager

Can you please add The-Drag-and-Drop-Component-Suite-for-Delphi to GetIt Package Manager ?

File dragged from Outlook Task have no filename

In TFileContentsStreamClipboardFormat.GetData if (FGD.GetData(DataObject)) then seems to fail here. FGD seems to have a valid format or multiple in my case.

I compiled ComboTargetDemo with Delphi 2007 and tested it on Windows 7 with Outlook 2013 / Windows 10 and Outlook 2017.

Example

Delphi 7 incompatibility

Hi!

Just want to let you know that the declaration of TCustomWideTextClipboardFormat in "DragDropText.pas" has a directive {$IF CompilerVersion >= 15.0} but it needs to be {$IF CompilerVersion >= 17.0} for it to compile in Delphi 7.

Happy New Year and Happy New Code! :)

Delphi 10 Seattle

Hello
When i try to build i have this errors:
[dcc32 Fatal Error] DragDropDR10S.dpk(1): E2225 Never-build package 'DragDropDR10S' must be recompiled
[dcc32 Fatal Error] dclDragDropDR10S.dpk(47): E2202 Required package 'DragDropDR10S' not found
Failed
Elapsed time: 00:00:00.2

copy / paste of outlook attachment / or from file explorer not working

Hello,

using the demo VirtualFile I cannot use the copy/paste operation from attachment neither from the windows file explorer.
The filename is ok but the content is always empty.
I've tried on two different computers.

No issue using the drag and drop but I unfortunately really need the copy/paste.

Could you help me to solve this issue ?

I use Windows 10 x64, Outlook 2019 32bits, VirtualFile 32bits, Delphi 10.3.3.

Thank you for your help.

David

Compile DragDropD2007 package

I had to comment this line in DropSource.pas to compile and install DragDropD2007.dpk :

DragBitmap.AlphaFormat := afDefined; // make sure alpha channel is not pre-multiplied

Demo only works outside of IDE - Solved

So here is what I've found.
IF I run the IDE (I'm using Delphi XE10s) as Admin (my default short-cut setting so that I can compile release version into ..\Program Files.. directory) then when debugging the exe is also runns with Admin priv, and drop-and-drop will not work. I have to run Delphi NOT as admin, then drop-and-drop works.

Drag and Drop transfer process abort itself around 25%

Hi, I've encountered an issue using your compontent.
If a file is dragged from an application using your library to another drag and drop compatible program trasfer abort itself around 25% of transferring process.
I'm experiencing this on a Windows 7 64bit machine.
The issue is easily reproducible using your demo project "AsyncSource with Filestreams", if I run the project and try to drag a large enough file (eg: from the default ftp specified in dropdownlist; "Index-bytime" 901Kb) the trasfer process stop without a deducible reason. I've tried to debug this behavior without finding a solution. Have you any ideas about it? How can it be solved?

64 Bit Outlook and Demo app

I have just downloaded the latest version of Drag & Drop. Have used in the past with older versions of Delphi and 32-bit Outlook.

Now using Delphi 10.3 and trying to drag a message from 64-bit Outlook to the Outlook Demo App ("DemosWithoutInstall/Outlook") and it doesn't work. The forbidden icon never changes and dropping has no effect.

I've tried compiling the demo app in 32 and 64 bit and it makes no difference.

I can drag and drop into explorer from Outlook without issue.

When I close the demo app, Outlook pops up a message

Either there is no default mail client or the current mail client cannot fulfill the messaging request. Please run Microsoft Outlook and set it as the default mail client.

I have had a browse online to see what is causing the above message and it looks like it might be a registry issue. I've tried various fixes recommended, but still get the issue (including full uninstall and reinstall of office).

Outlook appears to be correctly set as default mail app, but I wouldn't have thought that would be a problem anyway.

wrong mouse coordinates under W10 in a DPI virtualized application

use the commented code from

https://github.com/JBontes/DragDrop/blob/master/Source/DropTarget.pas#L1259

and add this to fix the point

var
l: TPoint;
m: TMonitor;
mi: TMonitorInfoEx;
dm: DEVMODE;
...
m := Screen.MonitorFromWindow(Result.Handle);
mi.cbSize := SizeOf(mi);
GetMonitorInfo(m.Handle, PMonitorInfo(@mi));
EnumDisplaySettings(mi.szDevice, Cardinal(-1), dm);
l := p;
if dm.dmPelsWidth <> mi.rcMonitor.Width then
begin
l.x := (l.x * mi.rcMonitor.Width) div dm.dmPelsWidth;
end;
if dm.dmPelsHeight <> mi.rcMonitor.Height then
begin
l.y := (l.y * mi.rcMonitor.Height) div dm.dmPelsHeight;
end;

WinRAR file drag

If one tries to drag and drop a file from WinRAR archive to the app, it fails because only the relative path inside the archive is available in the Files property. Is this a limitation by WinRAR or by the drag-drop component?

.Zip Files can't be dropped

Hi.

I don't know if this is a known issue, but it wasn't among the closed ones.
I made a simple Prototype Programm with this component but i can't drop .zip files.

It works if i just change the File-Extention but as soon as Windows recognises it as a .Zip file the Drop won't work.

I made a Stack-Overflow entry some time ago with some Informations i've gathered:
http://stackoverflow.com/questions/32653773

(I've already tried it with this Version)
I Hope you can help me.

Kind regards
Magiermacht

Berlin Install Raises Errors

When attempting to install DragDropDR101B.dpk I receive the following errors:
[dcc32 Fatal Error] DragDropDR101B.dpk(30): E2225 Never-build package 'designide' must be recompiled
[dcc32 Fatal Error] dclDragDropDR101B.dpk(47): E2202 Required package 'DragDropDR101B' not found

The package contains:
package DragDropDR101B;

{$R *.res}
{$IFDEF IMPLICITBUILDING This IFDEF should not be used by users}
{$ALIGN 8}
{$ASSERTIONS ON}
{$BOOLEVAL OFF}
{$DEBUGINFO OFF}
{$EXTENDEDSYNTAX ON}
{$IMPORTEDDATA ON}
{$IOCHECKS ON}
{$LOCALSYMBOLS OFF}
{$LONGSTRINGS ON}
{$OPENSTRINGS ON}
{$OPTIMIZATION ON}
{$OVERFLOWCHECKS OFF}
{$RANGECHECKS OFF}
{$REFERENCEINFO OFF}
{$SAFEDIVIDE OFF}
{$STACKFRAMES OFF}
{$TYPEDADDRESS OFF}
{$VARSTRINGCHECKS ON}
{$WRITEABLECONST OFF}
{$MINENUMSIZE 1}
{$IMAGEBASE $400000}
{$DEFINE RELEASE}
{$ENDIF IMPLICITBUILDING}
{$DESCRIPTION 'Drag and Drop Component Suite'}
{$RUNONLY}
{$IMPLICITBUILD OFF}

requires
rtl,
vcl;

contains
DragDrop in '..\Source\DragDrop.pas',
DragDropComObj in '..\Source\DragDropComObj.pas',
DragDropContext in '..\Source\DragDropContext.pas',
DragDropFile in '..\Source\DragDropFile.pas',
DragDropFormats in '..\Source\DragDropFormats.pas',
DragDropGraphics in '..\Source\DragDropGraphics.pas',
DragDropHandler in '..\Source\DragDropHandler.pas',
DragDropInternet in '..\Source\DragDropInternet.pas',
DragDropPIDL in '..\Source\DragDropPIDL.pas',
DragDropText in '..\Source\DragDropText.pas',
DropComboTarget in '..\Source\DropComboTarget.pas',
DropHandler in '..\Source\DropHandler.pas',
DropSource in '..\Source\DropSource.pas',
DropTarget in '..\Source\DropTarget.pas';

end.

Delphi 10 Seattle

Various stream size (etc.) declarations need to be changed to FixedUInt, LargeUInt, to compile with Delphi 10 Seattle.

How get Source directory with Delphi?

How to get the source path with this component suite? For example: I dropped file (virtual file) from my app to the desktop. I only need then source path i.e: Desktop. How to get this path before call DropFileSource1.Execute?
Here is my code on ListView1MouseDown procedure:
ipwFTP1.LocalFile :=source path+'salam.txt';

drag and drop from Outlook 2010 64-bit error

Hi Sven,

I have a problem with your component in Delphi XE7 compiling 64-bit.

I try to do a drag and drop from Outlook 2010 64-bit, but I encounter an error in the function LoadMAPI32 on :
GetProc('MAPIGetDefaultMalloc@0', pointer( @MAPIGetDefaultMalloc));

The error is :
"MAPI initialization failed: Failed to get mapi32.dll entry point for MAPIGetDefaultMalloc@0: The specified procedure could not be found. Drag and drop and paste will not be functional."

Outlook and my application are both administrator rights.

I made any kind of test, but now I do not know what to try.

Do you have an idea ?

Can't install component suit with Delphi XE4

Hello

i have problems installing the component suite with Delphi XE4. I am able to compile the DragDropDXE4.bpl and dclDragDropDXE4.bpl packages of the DragDropDXE4Group.groupproj but while installing the dclDragDropDXE4.bpl-package I'm getting the following error:

"Package C:\Users\Public\Documents\RAD Studio\11.0\Bpl\dclDragDropDXE4.bpl kann nicht geladen werden.
Das angegebene Modul wurde nicht gefunden."

At the mentioned path the dclDragDropDXE4.bpl file is there.

The same error occurs using the Delphinus package manager.
I tried it on several machines Win7 (64bit) and Win10 (64bit).
Do you have any idea what I am doing wrong?
Thank you for your help!

Regards

Marco

"VirtualFileStream" demo Source to browsers triggering "OnGetStream" many times

Using the "VirtuaFileStream" demo as source to windows explorer, it working fine. The event "OnGetStream" is triggered just once, when we drop releasing the mouse button.
But, using the same demo as source to some browser, as Google Chrome or Edge, the event "OnGetStream" is called many times while mouse move on them, even without the drop.

My app was creating the file in this event, I'm trying to move it to some other way,
even though, the "get" will happen many times, and the process done would depend on the page open on the browser.

There is some way to trigger the "OnGetStream" just once, as the explorer?

Explorer Shell Extension with Icon don't get Selected in W7 64

Hi, I made a Explorer Shell Extension based in ShellContextMenuHandlerSimple and works fine.
My problems start when I add a Icon (or BMP) to my Item Menu.
When an image is added the Menu still works as intended but dont change his background when is selected.
I try with a ImageList attached to PopUpMenu and ImageIndex for my ItemMenu and this is the result:

context2

When I made the same but with a Bitmap assigned directly to my ItemMenu the result is slightly better. Can I see a bit of the background changing at left (back of the image). Like this:

context1

It is as if the Menu Text were in a upper layer and cover the background.

Remarks:

I compile the ShellContextMenuHandlerSimple original without any changes and same result. The items with Bitmaps dont get his background changed.

I compile my Shell Extensions for 32 bit and tested in WinXP and works OK. (programatically and visually).

Any ideas?
Thanks in advance!

PD: My system W7 64 bits. Delphi XE2.

Edit: i just realized that the include of a bitmap in the Shell Extension Menu change drastically the visual of the all right click menu (at least the background part). Compare my Right Click menu with my extension without any bitmap (this is W7 regular behaviour) with the Shell Extension with bitmap.

context3context1

Always get drCancel dragging from SYSTEM

I don't think this is a component's bug, but i still cannot figure how to solve this:

My application runs over the SYSTEM account, and i'm trying to drag from my app and drop on a folder on C:\ (its a folder the SYSTEM account can read and write).

The drag drop works perfectly if i run my app from normal user account or from administrator, but running as SYSTEM always give me drCancel when i drop.

When dragging over the folders the mouse icon always have the correct visual feedback, before the drop i see the "+" near the cursor, but what i get is always a drCancel.

Do you have any idea on how to solve this? I'm sorry if this problem is not related to the component!

edit:
extra info: on the DropEmptySource feedback i get Effect = 1, as MSDN says (here: https://msdn.microsoft.com/en-us/library/windows/desktop/ms693457(v=vs.85).aspx ) its DROPEFFECT_COPY

edit2:
debugging i found that in DropSource.pas, line 1042, after the DoDragDrop completes, i get this with DRAGDROP_S_DROP result:
LogicalPerformedDropEffect = 0 (DROPEFFECT_NONE)
DropEffect = 0 (DROPEFFECT_NONE)
PerformedDropEffect = -1

forcing Result in drDropCopy doesn't help

Found a new issue on W10

Take W10 with two screens, and set the font size of one screen to 150%, the drag&drop from the 100% screen to the 150% screen don't work properly (Windows 10 < 1803, did not test for later versions).

BTW, the problem is that the component accept multiple components and need to find the drop target from the mouse position...in my case I have only one target registered, so in the FindTarget method I just exit from the loop when Targets.Count = 1 !

Another way could be to create an IDropTarget per component so you don't have to identify the target component anymore.

Regards
Paul

Drag and drop between two delphi executables

Hi.

Specifically I want to copy/move a structure like the following:

treenode+blobfield (in some cases it could be more than one set of treenode+blobfield)

I've been watching the demos but I'm not clear.

Can someone tell me?. A small explanation, an example of code, demos/sources to use, etc

Thanks in advance

Frustrated with Demos and components..

Hi Team,
Win 10, 64bit. Latest Drag&Drop, D10.4.1. 32bit Apps.
My specific need is to be able to drag & drop .jpg files into a Table Blob field via a DBImage component.
I installed D&D without issue. I then opened the SimpleTargetDemo just to see how it all fits together.
For some reason, DropImageTarget cannot see TImage as a Target. :-(
Hmmm. OK, add a DBImage to the Demo, ahh, it can see DBImage as a Target. :-)
Build & Run the App, grab a .jpg file and drag it over the DBImage area.
All I get is faded image of what I am trying to drop and a Stop symbol. :-(
I will be the first to admit I have probably got something wrong but I don't know what.
Please advise.
Regards & TIA,
Ian

AV - Possible bug in TCustomDropTarget.SetPerformedDropEffect

After upgrading to the most recent version of these controls (with the changes for Berlin 10.1) I started getting AV's when doing a drag/drop from a TVirtualTreeView into a DropHandler on another form. I tracked it down to what seems to be a change to TCustomDropTarget.SetPerformedDropEffect where two lines were added:
if Result then
ReleaseStgMedium(Medium);

This seems to be Releasing a Medium which then causes an AV when it later gets released again inside the VirtualTrees code in TVTDataObject.Destroy.

I am not an expert in Drag/Drop at all, so I'm not sure if the real error is inside the function mentioned above or it's inside the VirtualTree code (though removing the ReleaseStgMedium call from SetPerformedDropEffect has resolved my issue.

Problem with Drag & Drop within same application

If we use i.e. two Grids (file-list) and drag from one to the other grid (each grid has its own tDropComboTarget and tDropFileSource) the destination grid does not accept the file.

if we run the same app twice, we can drag & drop from First-App-Grid-No1 to Second-App-Grid-No2.

This error ocurred after we have upgraded Delphi from Tokyo update 2 to Tokyo Update 3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.