i have used following code to disable the Windows Control Panel. It successfully disables the Control Panel, but it needs a sytem restart to apply changes. Does anybody know how I can apply these changes to the Control Panel immediately, without requiring a system restart? Can anybody can help me?
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;