Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

MFS System Utility

0.00/5 (No votes)
25 Oct 2004 1  
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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here