Refresh the Windows Desktop (Views: 100)
How can I refresh the Windows desktop after I have set a new background image in the registry?
I want to post this article because I sure that this question can ask a lot of developers but to find an answer is not easy task.
So if you need refresh a desktop in run-time, you can execute a next procedure:
SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL);
This code will refresh a desktop image and re-read the icons for files with registered extentions.
PS: you can do a same if you press a right mouse button on desktop and select Update item.
procedure TForm1.Button1Click(Sender: TObject);
SendMessage(FindWindow('Progman', 'Program Manager'), WM_COMMAND, 106597, 0);
This has the same effect as pressing F5 in Explorer.
<< Back to main page