找到了:<br>SHChangeNotify(SHCNE_ASSOCCHANGED,SHCNF_IDLIST+SHCNF_FLUSH,nil,nil);//刷新文件关联图标<br>其中SHChangeNotify还有多个地方可以刷新,具体的看帮助!<br>SHChangeNotify(SHCNE_ALLEVENTS , SHCNF_FLUSH,nil,nil);//发生所有的事件,系统应该刷新响应的项目<br>function SHUpdateRecycleBinIcon():boolean;stdcall;external 'shell32.dll' name 'SHUpdateRecycleBinIcon';//刷新回收站图标<br>SendMessage(HWND_BROADCAST, WM_SETTINGCHANGE, 0, 0);//通知系统设置改变<br>var<br>buf
char;<br>...<br>getmem(buf,SizeOfBuf);//<br>strpcopy(buf,'注册表的主键,例如Software/Microsoft/windows/currentversion/Explorer/ToolBar');<br>SendMessage(HWND_BROADCAST,WM_SETTINGCHANGE,0,buf);<br>//通知系统刷新响应的键值,如果前面的没有起作用,那么可以采用这个方法。<br>systemparametersinfo(SPI_SETDESKWALLPAPER,0,pchar(path),0);<br>//上面的是通知系统更改了墙纸,其中path为墙纸的路径。<br>同样,SystemParametersInfo()还可以对系统进行很多方面的刷新,例如更改了桌面的大小等等,你可以看看帮助,我不可能在这儿把所有的都写出来。<br><br>要做到象Tweak UI那样Rebuild ICON,可以采用下面的方法:<br>:delphifan <br>这个问题确实很有意思,害得我找了很久,请看答案:<br><br> Reg := TRegistry.Create;<br> try<br> //设置图标<br> Reg.RootKey := HKEY_LOCAL_MACHINE;<br> if Reg.OpenKey('/Software/Microsoft/Windows/CurrentVersion/explorer/Shell Icons',True) then <br> Reg.WriteString('3','C:/WINDOWS/SYSTEM/shell32.dll,15');<br> //修改icon size<br> Reg.RootKey := HKEY_CURRENT_USER;<br> if Reg.OpenKey('/Control Panel/Desktop/WindowMetrics', True)<br> then Reg.WriteString('Shell Icon Size','31');<br> //通知windows<br> SendMessage(HWND_BROADCAST,WM_SETTINGCHANGE,0,0);<br> //当然别忘了改回来<br> Reg.WriteString('Shell Icon Size','32');<br> SendMessage(HWND_BROADCAST,WM_SETTINGCHANGE,0,0);<br> finally<br> Reg.CloseKey;<br> Reg.Free;<br> end;<br><br>关键是强迫windows重新刷新 icon cache,通过修改icon大小是一种可行的办法,<br>