在网上看不了贴,好像都没有根本解决此问题。特发贴寻求帮助。我用配置Desktop.ini、修改文件夹属性的方法设置了文件夹的图标。
当Desktop.ini 中IconFile 指向的图标文件改变时,我用以下方法刷新缓存:
SHFILEINFO fInfo = {0};
SHGetFileInfo (strDirPath,FILE_ATTRIBUTE_READONLY,&fInfo,sizeof(SHFILEINFO),SHGFI_SYSICONINDEX ); //获取index in the system image list (获取会成功)
SHChangeNotify(SHCNE_UPDATEIMAGE,SHCNF_DWORD,NULL,&fInfo.iIcon); //通知刷新但是没有效果。希望大家帮助,谢谢!

解决方案 »

  1.   

    http://blog.csdn.net/qiqi5521/archive/2008/05/27/2485313.aspx
      

  2.   

    上面的方法会使整个系统的图标缓都给刷新一次。影响太大。桌面也会严重的闪烁。难道就没有一种只刷新某一个图标缓存的办法吗?SHChangeNotify
    SHCNE_UPDATEIMAGE
    An image in the system image list has changed. SHCNF_DWORD must be specified in uFlags. 
    Windows NT/2000/XP: dwItem2 contains the index in the system image list that has changed. dwItem1 is not used and should be NULL.Windows 95/98: dwItem1 contains the index in the system image list that has changed. dwItem2 is not used and should be NULL.看MSDN的说明,好像就是来做这件事情的。但我没有成功。期待回复!
      

  3.   

    看看这个行不行。
    http://topic.csdn.net/t/20041202/10/3607954.html