枫
枫
Unregistered / Unconfirmed
GUEST, unregistred user!
unit Unit1;<br><br>interface<br><br>uses<br> Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,<br> StdCtrls;<br><br>type<br> TForm1 = class(TForm)<br> Label1: TLabel;<br> Memo1: TMemo;<br> procedure FormCreate(Sender: TObject);<br><br> private<br> procedure DragDropFiles(var msg:TMessage);<br> message WM_DROPFILES;<br> public<br> { Public declarations }<br> end;<br><br>var<br> Form1: TForm1;<br><br>implementation<br><br>{$R *.DFM}<br><br>procedure TForm1.FormCreate(Sender: TObject);<br>begin<br>DragAcceptFiles(Handle,True);<br>end;<br><br>procedure TForm1.DragDropFiles(var msg: TMessage);<br> var<br> char1:array[0..128]of char;<br> char2char ;<br> i,Sum:Integer ;<br>begin<br> sum:=DragQueryFile(msg.WParam,$FFFFFFFF,nil,0);<br> Label1.caption:='拖过来的文件有'+inttostr(Sum)+'个。';<br> char2:=@char1;<br>for i:=0 to Sum-1 do<br>begin<br>DragQueryFile(msg.WParam,i,char2,128);<br>FOrm1.Memo1.lines.add(char2);<br>end ;<br>DragFinish(msg.WParam);<br>end ;<br>end.<br><br>系统提示错示 DragFinish、DragQueryFile、DragAcceptFiles 这三个API函数没有声明<br>请问我错在那里了!!