我想知道有没有办法在不重新启动 shell 的情况下刷新 HKLM 注册表项 HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer.
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这不适用于我的情况.
在我看来,MS 制作了 Explorer,因此它在运行时无法重新读取其配置,这在我看来很疯狂)但您永远不知道.
It looks insane to me that MS made Explorer so it can't re-read its configuration while running) but you never know.
我尝试做的是禁用/启用通知区域(托盘)而无需重新启动.注册表项是
What I try to do is to disable/enable notification area (tray) without restarting. The registry key is
Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\
Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\
变量:NoTrayItemsDisplay
Variable: NoTrayItemsDisplay
值:1/0
编辑 2这是应该可以工作的源代码,但在 Vista 上却没有,不适用于通知区域,不适用于我的测试虚拟对象,即 startMenu 中的 MyMusic(变量 NoStartMenuMyMusic)
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; }我尝试了所有正常的 wparam 和 lparam 值,但没有成功.我从这里获取了代码伙计声称它有效......
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.
更可笑的是gpupdate 应该可以完成这项工作.
Whats even more ridiculous is that gpupdate is suposed to do the job.
谢谢.
推荐答案尝试发送 WM_SETTINGCHANGE 带有 wparam=0 和 lparam="Policy" 的消息到任务栏,不确定是否可以通过脚本来完成
Try sending the WM_SETTINGCHANGE message with wparam=0 and lparam="Policy" to the taskbar, not sure if this can be done with scripting
更多推荐
无需重新启动即可更新资源管理器配置
发布评论