user ShellAPI;//全局变量SHFileInfo:TSHFileInfo;//私有变量myImageList:TImageList;function GetFileIconIndex(FileName:string):integer; begin ShGetFileInfo(Pchar(FileName), 0, SHFileInfo,SizeOf( SHFileInfo), SHGFI_LARGEICON or SHGFI_SYSICONINDEX or SHGFI_TYPENAME or SHGFI_SMALLICON); Result:=SHFileInfo.iIcon; end;function LoadSysIco():boolean; var FStream:TFileStream; i:integer; begin MyImageList:=TImageList.CreateSize(32,32); myImageList.ShareImages:=True; myImageList.Handle:=ShGetFileInfo('',0,SHFileInfo, SizeOf(SHFileInfo),SHGFI_LARGEICON or SHGFI_ICON or SHGFI_SYSICONINDEX or SHGFI_SMALLICON); ListView1.SmallImages:=myImageList; ListView1.LargeImages:=myImageList; for i:=0 to ListView1.Items.Count-1 do begin FStream:=TFileStream.Create('c:/'+ListView1.Items.Caption,fmCreate); FStream.Write(i,sizeof(integer)); FStream.Free; ListView1.Items.Item.ImageIndex:=GetFileIconIndex('c:/'+ListView1.Items.Caption); deletefile('c:/'+ListView1.Items.Caption); end;