If you want to enable drag and drop to your application, all you have to do is to add this to the public section of your form.

procedure AcceptFiles( var msg : TMessage );message WM_DROPFILES;

After that, add “shellapi” unit to the implementation use.

implementation
uses shellapi;

And then the code for processing the drop files

procedure TForm1.AcceptFiles( var msg : TMessage );
const
cnMaxFileNameLen = 255;
var
i, nCount     : integer;
acFileName : array [0..cnMaxFileNameLen] of char;
begin
nCount := DragQueryFile( msg.WParam,$FFFFFFFF,acFileName,cnMaxFileNameLen );

for i := 0 to nCount-1 do
begin
DragQueryFile( msg.WParam, i,
acFileName, cnMaxFileNameLen );

MessageBox( Handle, acFileName, '', MB_OK );
end;

DragFinish( msg.WParam );
end;

To enable Drag and drop you have to add the following function to the formcreate

DragAcceptFiles( Handle, True );