public static void ToggleTaskManager(string keyValue)
{
RegistryKey objRegistryKey = Registry.CurrentUser.CreateSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System");
objRegistryKey.SetValue("DisableTaskMgr", keyValue);
objRegistryKey.Close();
}
private void btnDisableTaskManager_Click(object sender, EventArgs e)
{
ConsoleDisplay.ToggleTaskManager("1");
}
private void btnEnableTaskManager_Click(object sender, EventArgs e)
{
ConsoleDisplay.ToggleTaskManager("0");
}
For Disable/Enable TaskManager used above function but when i disable first time then it disable correctly.But when i click on enable button TaskManager not enabled.