急!!我用SHGetFileInfo函数取得文件的图标后,在WIN98中所有的小图标都不见了!!WINXP和WIN2000正常???(50分)

  • 主题发起人 主题发起人 漠风
  • 开始时间 开始时间

漠风

Unregistered / Unconfirmed
GUEST, unregistred user!
我用SHGetFileInfo(Pchar(filename),0,FileInfo,sizeof(FileInfo),<br>&nbsp; &nbsp; &nbsp; &nbsp; SHGFI_SYSICONINDEX or SHGFI_USEFILEATTRIBUTES or SHGFI_SMALLICON);<br>提取出文件的小图标后,WINDOWS98系统中所有的小图标都消失了。打开资源管理器,<br>所有的文件夹图标和文件图标都没有了。而在WIN2000和WINXP中运行却正常。是不是<br>在WINDOWS98中还需要什么参数。<br>请各位高手赐教。源码如下:<br>&nbsp; &nbsp; &nbsp; &nbsp; FillChar(FileInfo, SizeOf(FileInfo), #0);<br>&nbsp; &nbsp; &nbsp; &nbsp; if (copy(mylist.a1,1,1) = 'd') &nbsp;then &nbsp; //取目录图标<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SHGetFileInfo(Pchar(extractfilepath(application.ExeName )),0,FileInfo,sizeof(FileInfo),<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SHGFI_SYSICONINDEX or SHGFI_SMALLICON)<br>&nbsp; &nbsp; &nbsp; &nbsp; else//取文件图标<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SHGetFileInfo(Pchar(mylist.a9),0,FileInfo,sizeof(FileInfo),<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SHGFI_SYSICONINDEX or SHGFI_USEFILEATTRIBUTES or SHGFI_SMALLICON);<br>&nbsp; &nbsp; &nbsp; &nbsp; listitem:=listview1.Items.Add ;<br>&nbsp; &nbsp; &nbsp; &nbsp; ListItem.ImageIndex :=FileInfo.iIcon ; &nbsp;
 
你是不是另外还有代码,ImageList变量指向系统图标列表,又不共享,就把它释放了?
 
接受答案了.
 
你不要吧imagelist.shareimage的属性设为true<br>!
 

Similar threads

后退
顶部