Click here to Skip to main content
Click here to Skip to main content
Alternative Tip

Tagged as

Enabling and Disabling TaskManager

, 28 Jun 2011
Rate this:
Please Sign up or sign in to vote.
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")) {...
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);
              }
          }
      }

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

George Swan
Student
Wales Wales
No Biography provided

Comments and Discussions

 
Generalupdated my vote to 4 works just great but stil perfer my met... Pinmembercharles henington28-Jun-11 11:20 
GeneralSorry Charles, I thought the subkey already existed. I've te... PinmemberGeorge Swan28-Jun-11 6:59 
GeneralReason for my vote of 1 Yes it very well could be I just per... Pinmembercharles henington28-Jun-11 5:41 
GeneralReason for my vote of 1 Yes it very well could be I just per... Pinmembercharles henington28-Jun-11 5:40 
GeneralReason for my vote of 3 Yes it very well could be I just per... Pinmembercharles henington28-Jun-11 5:13 
GeneralReason for my vote of 3 Yes it very well could be I just per... Pinmembercharles henington28-Jun-11 5:12 
GeneralReason for my vote of 3 Yes it very well could be I just per... Pinmembercharles henington28-Jun-11 5:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web01 | 2.8.140814.1 | Last Updated 28 Jun 2011
Article Copyright 2011 by George Swan
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid