Couldn't the
class RegEdit
be replaced by one simple method?
private void SetKey(bool enableTaskManager)
{
using (
var mKey =
Registry.CurrentUser.CreateSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System"))
{
if (mKey != null)
{
mKey.SetValue("DisableTaskMgr", enableTaskManager ? 0 : 1);
}
}
}