2
21816588
Unregistered / Unconfirmed
GUEST, unregistred user!
在Form中只放一个Edit1,当外部文件拖到edit1里时,显示外部文件的路径和文件名怎样实现?希望能说详细点,或是给个例子,谢谢!
(我很菜)
另外我看了一个,但不行
Procedure FinishDropped ( VAR Msg : TMessage );Message WM_DropFiles ;
Var
hDrop : THandle ;
FileName char;
CountOfFiles : integer ;
FileIndex : integer ;
begin
hDrop := Msg.WParam ;
getmem(FileName ,255);
try
CountOfFiles := DragQueryFile(hDrop,0,FileName ,254);
if (CountOfFiles<>0) then
Edit1.Text:=strPas(FileName );
finally
FreeMem(FileName );
end;
DragFinish ( hDrop);
end ;
已在private加入
procedure DropFiles(var Msg: TMessage); message WM_DROPFILES;
(我很菜)
另外我看了一个,但不行
Procedure FinishDropped ( VAR Msg : TMessage );Message WM_DropFiles ;
Var
hDrop : THandle ;
FileName char;
CountOfFiles : integer ;
FileIndex : integer ;
begin
hDrop := Msg.WParam ;
getmem(FileName ,255);
try
CountOfFiles := DragQueryFile(hDrop,0,FileName ,254);
if (CountOfFiles<>0) then
Edit1.Text:=strPas(FileName );
finally
FreeMem(FileName );
end;
DragFinish ( hDrop);
end ;
已在private加入
procedure DropFiles(var Msg: TMessage); message WM_DROPFILES;