Click here to Skip to main content
15,886,091 members
Articles / Desktop Programming / ATL
Article

MFS System Utility

Rate me:
Please Sign up or sign in to vote.
2.85/5 (35 votes)
25 Oct 2004CPOL7 min read 71.7K   1.2K   28   19
This application provides General Restriction to local computer like hiding/showing of drives and other UI thngs using registry.

Sample Image - SysUtil.gif

Introduction

Let's Start.

  1. Disable/Enable Drives

    My whole software depends upon registry and you know that the registry is the wealth for a system programmer as M$ or rather say Windows very much depends upon registry but for utilizing its capacity, you must know right registry location or you can download registry guide from here.

    Now, take a look at the application. First look at drives, now the disabling and enabling of drives are stored in the key,

    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer

    in value 'NoDrives'. Now data of this value depends on number of drives your system contains. Let's take an example, if your system contains A: C: D: drives, and you want to disable C drive. The entry in registry would be 2 int(65-'C'), and if you want to disable A: and D: the registry value is 2((65-int('A'))+(65-int('d'))). OK, I think you understand this mechanism. Don't worry, I have created the wrapper for this in my DLL, so just use them.

  2. Disable Control Panel.

    The key holding data to show or hide Control Panel is:

    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer

    and value name is "NoControlPanel". If its value is 0, you can see Control Panel and if 1, you can't see Control Panel.

  3. Disable Change Password.

    This option you are going to see when u press (CTRL+ALT+DEL) in WIN2000 and above.

    And its key is:

    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System

    and value name is "DisableChangePassword" . If its value is 0, you can see Change Password option enabled and if 1, Change Password Option is disabled.

  4. Disable Search.

    This option you are going to see in Start menu and its key is:

    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
    and value name is "NoFind". If its value is 0, you can see this option enabled and if 1, you can't see that option.
  5. Disable RUN

    This option you are going to see in Start menu and its key is:

    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer

    and Value Name is "NoRun". If its value is 0, you can see this option enabled and if 1, you can't see that option.

  6. Disable ShutDown.

    This option you are going to see in Start menu and its key is:

    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer

    and value name is "NoClose". If its value is 0, you can see this option enabled and if 1, you can't see that option.

  7. Disable NetworkAccess.

    This option you are going to see at Desktop and its key is:

    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer

    and value name is "NoNetHood". If its value is 0, you can see this option enabled and if 1, you can't see that option.

  8. Disable NetworkAccess.

    This option you are going to see at Desktop and its key is:

    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer

    and value name is "NoNetHood". If its value is 0, you can see this option enablee and if 1, you can't see that option.

  9. Disable TaskBar Setting.

    This option you are going to see at Desktop and its key is:

    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer

    and value name is "NoSetTaskBar". If its value is 0, you can see this option enable and if 1, you can't see that option.

  10. Disable TaskBar Setting.

    This option you are going to see when you right click on StartMenu and its key is:

    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer

    and value name is "NoSetTaskBar". If its value is 0, you can see this option enabled and if 1, you can't see that option.

  11. Disable RegEdit.

    This is registry editor tool.

    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System

    Value name is "DisableRegistryTools". If its value is 0, you can see this option enabled and if 1, you can't see that option.

  12. Disable TaskManager

    This option you are going to see usually in Windows 2000 and above when you press (CTRL+ALT_DEL), its key is:

    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System

    and value name is "DisableTaskMgr". If its value is 0, you can see this option enabled and if 1, you can't see that option.

  13. Disable Context Menu.

    This option you are going to see when you right click on Desktop. The menu occurs is known as Context menu and its key is:

    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer

    and value name is "NoViewContextMenu". If it value is 0, you can see this option enabled and if 1, you can't see that option.

  14. Disable Desktop icon.

    This option applies to all the icons present on desktop, its key is:

    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer

    and value name is "NoDesktop". If its value is 0, you can see this option enable and if 1, you can't see that option.

  15. Disable Display Properties.

    This option you are going to see when you right click on Desktop and click on Properties menu item and its key is:

    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System
    and value name is "NoDispCPL". If its value is 0, you can see this option enable and if 1, you can't see that option.

  16. Disable Background TAb.

    This option you are going to see in Display Control Panel and its key is:

    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System

    and value name is "NoDispBackgroundPage". If its value is 0, you can see this option enable and if 1, you can't see that option.

  17. Disable ScreenSaver TAb.

    This option you are going to see in Display Control Panel and its key is:

    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System
    and value name is "NoDispScrSavPage". If its value is 0, you can see this option enable and if 1, you can't see that option.

  18. Disable Setting and Plus Tab.

    This option you are going to see in Display Control Panel and its key is:

    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System

    and value name is "NoDispSettingsPage". If its value is 0, you can see this option enable and if 1, you can't see that option.

  19. Disable Appearance Tab.

    This option you are going to see in Display Control Panel and its key is:

    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System
    and value name is "NoDispAppearancePage". If its value is 0, you can see this option enable and if 1, you can't see that option.

I think, I have explained each function of my S/W. Remember one thing, some of these options shows effect only when the computer is restarted.

USING OF SOFTWARE

  • Just check on the restriction you want to apply and click apply, the restrictions are applied.
  • No need of worry. This s/w is working very fine. I am testing it daily. If it can apply restriction, it can disapply it also. No need to worry. In Hindi I will say like that "MAIN HOIN NAA", I am there for help you out if any problem occur.
  • Don't need to note of applied or disapplied restrictions, when you start my S/W the checked boxes are showing the restriction applied on that Current User and unchecked boxes showing unapplied restrictions.
  • Remember, most of restriction after applying and disapplying need restarting of your computer, OK.

Working OF CNMPDrivesClass

The declaration of class is this:

class AFX_EXT_CLASS CNMPDrivesClass 
{ 
 
  CString NMPChangeToBinary(DWORD dwVar);

 public:

  void SendTypeOFDrives(CUIntArray &Stat);
  void SendStatusOFDrives(CUIntArray &stat);
  BOOL GetDrivesVolume(CStringArray &VolumeName,CDWordArray 
          SerialNumber,CStringArray &FileSystem);
  void NMPReturnNoOfDrives(CUIntArray &NoOfDrives);

  void NMPDisableLocalDrives(CUIntArray &a);
  
  CRegKey m_LocalKey;
  CNMPDrivesClass();
  CNMPDrivesClass(CString SID);
  CNMPDrivesClass(BOOL bUser);
  virtual ~CNMPDrivesClass();
 
 private:
  CRegKey f;

};

Now let me explain the working of each function.

  • void SendTypeOFDrives(CUIntArray &Stat);

    This function sends the types of drives present in the computer. Its argument is CUIntArray and value come according to drives like:

    If your computer has drives A: C: D: and E:,

    Array [0] - A: information

    Array [1] - C: information

    Array [2] - D: information

    Array [3] - E: information

    Now return value meanings:

    1. 0 stands for Floppy Drive.
    2. 1 stands for HardDisk.
    3. 2 stands for CDROM.
    4. 3 stands for RAMDISK.
    5. 4 for network drives.
    6. 5 for unknown or can't be retrieved.
  • void SendStatusOFDrives(CUIntArray &stat);

    This function will tell the status of drives either it is enabled or disabled. Its argument contains the Drives int which are disabled. e.g. int(65) stand for A, int (66) for B and so on.

    Now let me explain this with a small example.

    Let's assume your computer had A:,C:,D:,E: Drives and C: and D: are disabled. So size of returning array Stat is 2. Then, Stat[0]=C and &Stat[1]=D.

  • BOOL GetDrivesVolume(CStringArray &VolumeName,CDWordArray SerialNumber,CStringArray &FileSystem);

    This function contains the information about volume name, serial number and fIle system of drives, and its sequence is same as the above.

    Like if your computer has drives A: C: D: and E:,

    Array [0] - A: information

    Array [1] - C: information

    Array [2] - D: information

    Array [3] - E: information

  • void NMPReturnNoOfDrives(CUIntArray &NoOfDrives);

    This function returns the number of drives, the local system contains, but it will return integer equivalent of character.

    e.g. If your computer has drives A: C: D: and E:,

    Array [0]:65 - i.e. A (According to ASCII character set).

    Array [1]:67 - i.e. C (According to ASCII character set).

    Array [2]:68 - i.e. D (According to ASCII character set).

    Array [3]:69 - i.e. E (According to ASCII character set).

  • void NMPDisableLocalDrives(CUIntArray &a);

    This function will disable the local drives in the computer, but remember it will erase the previous values before writing to it.

    Now if you want to disable A: and C:, just do add like a.Add(A), a.Add(C) (Because a is an array class) and call the function,

    NMPDisableLocalDrives(a);

    And voila! After restart the A: & C: are not visible on the Explorer.

Special Thanks

  • To my friend Amit Mehta (who is studying in Australia and I am really missing him a lot).
  • To my mother and father (for their care).

License

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


Written By
Software Developer (Senior)
India India
He used to have biography here Smile | :) , but now he will hire someone (for free offcourse Big Grin | :-D ), Who writes his biography on his behalf Smile | :)

He is Great Fan of Mr. Johan Rosengren (his idol),Lim Bio Liong, Nishant S and DavidCrow and Believes that, he will EXCEL in his life by following there steps!!!

He started with Visual C++ then moved to C# then he become language agnostic, you give him task,tell him the language or platform, he we start immediately, if he knows the language otherwise he quickly learn it and start contributing productively

Last but not the least, For good 8 years he was Visual CPP MSMVP!

Comments and Discussions

 
QuestionHow can do it with c# Pin
H.R25-Jul-08 19:40
H.R25-Jul-08 19:40 
AnswerRe: How can do it with c# Pin
David Crow28-Aug-09 3:33
David Crow28-Aug-09 3:33 
GeneralWindows Vista Support ! Pin
prateec27-Apr-08 23:32
prateec27-Apr-08 23:32 
GeneralRe: Windows Vista Support ! Pin
ThatsAlok28-Aug-09 0:38
ThatsAlok28-Aug-09 0:38 
QuestionWindows 98, not working ? Pin
Bui Tan Duoc4-Feb-07 22:55
professionalBui Tan Duoc4-Feb-07 22:55 
AnswerRe: Windows 98, not working ? Pin
ThatsAlok4-Feb-07 23:00
ThatsAlok4-Feb-07 23:00 
Generalfound a bug Pin
Tran Duy Hung29-Sep-05 20:40
Tran Duy Hung29-Sep-05 20:40 
GeneralRe: found a bug Pin
ThatsAlok29-Sep-05 20:44
ThatsAlok29-Sep-05 20:44 
GeneralRe: found a bug Pin
10-Oct-05 7:52
suss10-Oct-05 7:52 
Generaluser windows registry Pin
densitet3-Mar-05 2:40
densitet3-Mar-05 2:40 
Generalhttp://www.winguide.com/ Pin
Arsalan Malik2-Dec-04 22:54
Arsalan Malik2-Dec-04 22:54 
GeneralRe: http://www.winguide.com/ Pin
ThatsAlok3-Dec-04 2:27
ThatsAlok3-Dec-04 2:27 
Generalgood post but very low rating Pin
Sudhir Mangla15-Jul-04 18:35
professionalSudhir Mangla15-Jul-04 18:35 
GeneralRe: good post but very low rating Pin
gugul6-Nov-04 4:15
sussgugul6-Nov-04 4:15 
GeneralPoor-quality screen shots Pin
David Crow15-Jul-04 8:36
David Crow15-Jul-04 8:36 
GeneralRe: Poor-quality screen shots Pin
Miguel Lopes15-Jul-04 8:40
Miguel Lopes15-Jul-04 8:40 
GeneralRe: Poor-quality screen shots Pin
Sudhir Mangla15-Jul-04 18:44
professionalSudhir Mangla15-Jul-04 18:44 
GeneralRe: Poor-quality screen shots Pin
ThatsAlok15-Jul-04 19:58
ThatsAlok15-Jul-04 19:58 
GeneralRe: Poor-quality screen shots [modified] Pin
ThatsAlok15-Jul-04 19:35
ThatsAlok15-Jul-04 19:35 

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

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