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.
for disabling TaskManager you must set a DWord string in Registry( User Local Machine instead of Current User). Use following code.( It not working in windows 7)
for That user application must run under Admin Permission. change following change in app.manifest for using application in Admin Permission
Yes, delete will work. Means, use this code to toggle:
or this code to set:
answer 4 is Okey But Uu need one more litte code this %100 true (RegistryValueKind.DWord) ;
Try this:
For Enable/Desable: (Sorry, my English is very bad...)
Note: You must have administrator access to run the program.
Try Deleting the Key instead of setting the value to False