The code below calls SHGetSetSettings function to hide desktop icons but it just unchecked "Show desktop icons" from the view menu.
I called SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_FLUSHNOWAIT, nil, nil);
to update the desktop but that doesn't work?
var
lpss: SHELLSTATE;
begin
lpss.Data := High(cardinal);
lpss.Data2 := Low(cardinal);
SHGetSetSettings(lpss,SSF_HIDEICONS,true);
SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_FLUSHNOWAIT, nil, nil);
end;
See Question&Answers more detail:os