...in einem Verzeichnis-Baum nach einer bestimmten Datei suchen?
|
Autor:
Thomas Stutz |
[ Tip ausdrucken ] | | |
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), #00);
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;
Bewerten Sie diesen Tipp:
|
|
|