procedure TForm1.Button3Click(Sender: TObject);
const
SFile = 'D:/WINDOWS/system32/shell32.dll';
var
i : Integer;
Count : Integer;
hIcon : HWND;
icon : TIcon;
begin
Count := -1;
Count := ExtractIcon(HInstance, SFile, Count);
icon := TIcon.Create;
try
for i := 0 to Count - 1 do
begin
hIcon := ExtractIcon(HInstance, sFile, i);
icon.Handle := hIcon;
imgList.AddIcon(icon);
lstView.Items.Add.ImageIndex := i;
end;
finally
icon.Free;
end;
end;