那样没做过,不过可以给你个相关的例子:<br><br>Uses ShellApi;<br><br>function GetFileIcon(const Filename: string;<br> SmallIcon: Boolean=true): HICON;<br>var<br> info: TSHFILEINFO;<br> Flag: Integer;<br> Icon: TICON;<br>begin<br> result := 0;<br> if Not FileExiSts(FileName) then<br> Exit;<br> Icon := TIcon.Create;<br> Try<br> if SmallIcon then<br> Flag := (SHGFI_SMALLICON or SHGFI_ICON)<br> else<br> Flag := (SHGFI_LARGEICON or SHGFI_ICON);<br> SHGetFileInfo(Pchar(Filename), 0, info, Sizeof(info), Flag);<br> Result := info.hIcon;<br> Icon.Handle := Result;<br> Except<br> end;<br>end;