Retiro mi duda
ya lo tengo!
Código:
procedure GetFileIcon(ImageList: TImageList; ListItem: TListItem; Name: String;
IconSize: TIconSize);
var
FInfo: TSHFileInfo;
ImageListHandle: THandle;
begin
if IconSize = isLarge then
ImageListHandle := SHGetFileInfo(PAnsiChar(Name),0,FInfo,SizeOf(TSHFileInfo),
SHGFI_LARGEICON or SHGFI_SYSICONINDEX or SHGFI_USEFILEATTRIBUTES)
else
ImageListHandle := SHGetFileInfo(PAnsiChar(Name),0,FInfo,SizeOf(TSHFileInfo),
SHGFI_SMALLICON or SHGFI_SYSICONINDEX or SHGFI_USEFILEATTRIBUTES);
SendMessage(ListItem.Owner.Owner.Handle, LVM_SETIMAGELIST, LVSIL_SMALL, ImageListHandle);
SendMessage(ListItem.Owner.Owner.Handle, LVM_SETIMAGELIST, LVSIL_NORMAL, ImageListHandle);
ListItem.ImageIndex := FInfo.iIcon;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
ListView1.Items.Add.Caption := Edit1.Text;
GetFileIcon(ImageList1,ListView1.Items.Item[ListView1.Items.Count-1],Edit1.Text,isSmall);
end;
Este es el código, funciona!