Искать нужный файл в дереве каталогов
Оформил: DeeCo
Автор: http://www.swissdelphicenter.ch
uses
ImageHlp;
function SearchForFile(const ARootPath: string;
const AFileName: string;
var APathFound: string): Boolean;
var
Found: array[0..500] of Char;
begin
FillChar(Found, SizeOf(Found), #0 );
Result := (SearchTreeForFile(PChar(ARootPath), PChar(AFileName), Found) = True);
APathFound := ExtractFilePath(Found);
end;
procedure TForm1.Button1Click(Sender: TObject);
var
APathFound: string;
begin
if SearchForFile('C:\WINDOWS\', 'winhlp32.exe', APathFound) then
ShowMessage('winhlp32.exe found in: ' + APathFound);
end;
|