private
; ; { Private declarations }
; procedure wmdropfiles(var msg:twmdropfiles);message wm_dropfiles;
;procedure tform2.wmdropfiles(var msg:twmdropfiles);
var
numfiles:longint;
i:longint;
buffer:array[0..255] of char;
begin
numfiles:=dragqueryfile(msg.drop,$ffffffff,nil,0);
for i:=0 to (numfiles-1) do
begin
dragqueryfile(msg.drop,i,@buffer,sizeof(buffer));
form2.listbox1.Items.Add(buffer);
form2.ListBox1.ItemIndex:=form2.ListBox1.Items.count-1;
end;
dragfinish(msg.drop);
end;
procedure TForm2.FormCreate(Sender: TObject);
begin
dragacceptfiles(form2.handle,true);
end;