Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 Windows 中,要更新环境变量,我需要向所有应用程序广播消息 WM_SETTINGCHANGE,例如
SendMessageW(HWND_BROADCAST, WM_SETTINGCHANGE, 0, L"Environment");
但是,在 Session 0 中运行的服务需要将环境变量模板添加到注册表并将更改广播到 User Session 时会发生什么情况?据我所知,SendMessage 不能跨会话发送。在这种情况下我能做什么?