简体   繁体   中英

Update Explorer configuration without restarting it

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.

尝试将带有wparam = 0和lparam =“Policy”的WM_SETTINGCHANGE消息发送到任务栏,不确定是否可以使用脚本执行此操作

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM