Update explorer configuration without rebooting

I'm wondering if there is a way to update 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 this?

So far I've only found this thing:

RUNDLL32.EXE USER32.DLL,UpdatePerUserSystemParameters ,1 ,True

      

which doesn't work for my case.

It seems insane to me that MS made Explorer to prevent it from re-reading its configuration while it is running), but you never know.

EDIT: I'm trying to disable / enable the notification area (tray) without restarting. Registry key

Software \ Microsoft \ Windows \ CurrentVersion \ Policies \ Explorer \

Variable: NoTrayItemsDisplay

Value: 1/0

EDIT 2 This is the original code that should work, but in Vista it is not, not for the notification area, not for my testing dummy, which was MyMusic in startMenu (NoStartMenuMyMusic variable)

#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've tried all sane wparam and lparam values ​​with no success. I took the code from here and the dude claims it works ...

This article , however, claims that the code doesn't work.

What's even funnier is the gpupdate to get the job done.

thank.

+2


source to share


1 answer


Try sending a WM_SETTINGCHANGE message using wparam = 0 and lparam = "Policy" in the taskbar, not sure if this can be done with a script



+1


source