在网上看不了贴,好像都没有根本解决此问题。特发贴寻求帮助。我用配置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); //通知刷新但是没有效果。希望大家帮助,谢谢!
当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); //通知刷新但是没有效果。希望大家帮助,谢谢!
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的说明,好像就是来做这件事情的。但我没有成功。期待回复!
http://topic.csdn.net/t/20041202/10/3607954.html