unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ID3V2, ShellApi, StdCtrls;
type
TForm1 =
class(TForm)
files: TListBox;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
procedure WMDROPFILES(
var Msg: TMessage);
message WM_DROPFILES;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.WMDROPFILES(
var Msg: TMessage);
var i, anzahl, size: integer;
Dateiname: PChar;
begin
inherited;
Dateiname := '
';
anzahl := DragQueryFile(Msg.WParam, $FFFFFFFF, Dateiname, 255);
for i := 0
to (anzahl - 1)
do
begin
size := DragQueryFile(Msg.WParam, i ,
nil, 0) + 1;
Dateiname:= StrAlloc(size);
DragQueryFile(Msg.WParam, i, Dateiname, size);
files.Items.Add(Dateiname);
StrDispose(Dateiname);
end;
DragFinish(Msg.WParam);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
DragAcceptFiles(Form1.Handle, true);
end;
end.