无需重新启动即可更新资源管理器配置

编程入门 行业动态 更新时间:2024-10-28 00:28:58
本文介绍了无需重新启动即可更新资源管理器配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想知道有没有办法在不重新启动 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

更多推荐

无需重新启动即可更新资源管理器配置

本文发布于:2023-11-03 19:52:31,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1555936.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:重新启动   资源管理器

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!