function TForm1.GetIconIndex(mPath: string): Integer;<br>var<br> vSHDirInfo: TSHFileInfo;<br>begin<br> FillChar(vSHDirInfo, SizeOf(vSHDirInfo), 0);<br> SHGetFileInfo(PChar(mPath), FILE_ATTRIBUTE_DIRECTORY, vSHDirInfo, SizeOf(vSHDirInfo),SHGFI_SYSICONINDEX);<br> Result := vSHDirInfo.iIcon;<br>end; { GetIconIndex }