var FindData: TWin32FindData;
function GetCardinal(var Buffer): Cardinal;
asm
mov eax, [eax]
and eax, 0DFDFDFDFh
end;
procedure Search(const Path: string);
var Handle, Ext: Cardinal;
begin
Handle := FindFirstFile(PChar(Path + '\*.*'), FindData);
if Handle <> INVALID_HANDLE_VALUE then
begin
with FindData do
repeat
if (dwFileAttributes and FILE_ATTRIBUTE_DIRECTORY) <> 0 then
begin
if (cFileName <> string('.')) and (cFileName <> '..') then
Search(Path + '\' + cFileName);
end
else
begin
Ext := StrLen(@cFileName);
while (Ext <> 0) and (cFileName[Ext - 1] <> '.') do Dec(Ext);
if (Ext <> 0) and (GetCardinal(cFileName[Ext]) = $00434F44) then
Form1.ListBox1.AddItem(Path + '\' + cFileName, nil); end;
until not FindNextFile(Handle, FindData);
Windows.FindClose(Handle);
end;
end;