no need for a component for drag & drop in delphi
Code:
uses
// snip
shellApi; // [edit] shell api might not be necessary, but you might want to check out the shellExec() and shellExecEx() functions...
type
TForm1 = class(TForm)
OpenDialog1: TOpenDialog;
procedure FormCreate(Sender: TObject);
private
// snip
public
// snip
procedure WMDROPFILES(var Message: TWMDROPFILES); message WM_DROPFILES;
end;
implementation
procedure TForm1.FormCreate(Sender: TObject);
begin
DragAcceptFiles(Handle, True);
end;
procedure TForm1.WMDROPFILES(var Message: TWMDROPFILES);
var
NumFiles : longint;
i : longint;
buffer : array[0..255] of char;
begin
{How many files are being dropped}
NumFiles := DragQueryFile(Message.Drop,
$FFFFFFFF,
nil,
0);
{Accept the dropped files}
// OpenDialog1.Files.Clear; // optional
for i := 0 to (NumFiles-1 ) do begin
DragQueryFile(Message.Drop,
i,
@buffer,
sizeof(buffer));
OpenDialog1.Files.Add(buffer);
end;
esby