我使用以下代码禁用 Windows 控制面板。它成功禁用了控制面板,但需要重新启动系统才能应用更改。有谁知道我如何可以立即将这些更改应用到控制面板,而无需重新启动系统?任何人都可以帮助我吗?
RegistryKey RegKey = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Policies\Explorer");
RegKey.SetValue("NoControlPanel", true, RegistryValueKind.DWord); RegKey.Close();
RegKey = Registry.LocalMachine.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Policies\Explorer");
RegKey.SetValue("NoControlPanel", true, RegistryValueKind.DWord); RegKey.Close();
//registry
RegKey = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\
Group Policy Objects\LocalUser\Software\Microsoft\Windows\CurrentVersion\Policies\System");
RegKey.SetValue("DisableRegistryTools", true, RegistryValueKind.DWord); RegKey.Close();
RegKey = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Policies\System");
RegKey.SetValue("DisableRegistryTools", true, RegistryValueKind.DWord); RegKey.Close();
return true;