例子:
procedure TForm1.Button1Click(Sender: TObject);
var data:TWin32FindData;
begin
if Button1.Caption='查找文件' then
begin
handle:=FindFirstFile(PChar(Edit1.Text),data);
ShowFileInfo(data);
Button1.Caption:='查找下一个';
end
else
begin
if NOT FindNextFile(handle,data) then
begin
Windows.FindClose(handle);
Button1.Caption:='查找文件';
end
else
ShowFileInfo(data);;
end;
end;
function TForm1.ShowFileInfo(data:TWin32FindData);
begin
//对data进行处理
end;