在Delphi里 DragAcceptFiles,DragQueryFile,DragFinish如何正确使用?
请问DragAcceptFiles,DragQueryFile,DragFinish三个win API函数为什么在Delphi 5/6里不能使用?其中DragAcceptFiles在FormCreate函数中使用。是不是在uses子句中还要加什么unit?如果能用,请说明如何使用或给出例程。
procedure TForm1.FormCreate(Sender: TObject);
begin
DragAcceptFiles(Handle,true);
end;
procedure TForm1.DragDropFiles(var Msg: TMessage);//消息处理函数
var
fileSum:Integer;
begin
FileSum:=DragQueryFile(HDROP(msg.WParam),$ffffffff,nil,0);
//此处为一些处理语句。
DragFinish(HDROP(msg.WParam));
end;