只刷新桌面

std::wstring GetSpecialFolderPath(int csidl) 
{
	std::wstring strPath;
	TCHAR szCommonStartMenuPath[MAX_PATH] = { 0 };
	if (SHGetSpecialFolderPath(NULL, szCommonStartMenuPath, csidl, true))
		strPath = szCommonStartMenuPath;

	return strPath.empty() ? L"" : strPath + L"\\";
}
SHChangeNotify(SHCNE_UPDATEDIR, SHCNF_PATH | SHCNF_FLUSHNOWAIT, GetSpecialFolderPath(CSIDL_COMMON_DESKTOPDIRECTORY).c_str(), NULL);

刷新桌面及任务栏

	SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL);

Q.E.D.