I am wondering is there a way to refresh the HKLM registry key HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer - without restarting the shell.
I would like to be able to do this without restarting explorer. Is there any known way to do that ?
So far, I found only this thing:
RUNDLL32.EXE USER32.DLL,UpdatePerUserSystemParameters ,1 ,True
which doesn't work for my case.
It looks insane to me that MS made Explorer so it can't re-read its configuration while running) but you never know.
EDIT: What I try to do is to disable/enable notification area (tray) without restarting. The registry key is
Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\
Variable: NoTrayItemsDisplay
Value: 1/0
EDIT 2 This is the source code that supposed to work, but on Vista it doesn't, not for notification area, not for my testing dummy which was MyMusic in startMenu (variable NoStartMenuMyMusic)
#include <stdio.h>
#include <windows.h>
int _tmain(int argc, _TCHAR* argv[])
{
DWORD dwRetVal;
int lResult = SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, (WPARAM)0,
(LPARAM)"Policy",
SMTO_ABORTIFHUNG, 5000, &dwRetVal);
printf("lResult = %ld\n", lResult);
printf("dwRetVal = %ld\n", dwRetVal);
return 0;
}
I tried all sane wparam and lparam values without success. I took the code from here and dude claims it works...
This article, however, claims that code doesn't work.
Whats even more ridiculous is that gpupdate is suposed to do the job.
Thx.