MFS System Utility
This application provides General Restriction to local computer like hiding/showing of drives and other UI thngs using registry.
- Download NMPRegDLL code (not included with Demo Project) - 23.8 Kb
- Download demo project (includes SysUtil code and application) - 47.1 Kb
Introduction
Let's Start.
- 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.
- 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.
- 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.
- 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. - 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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. - 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.
- 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. - 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.
- 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:
- 0 stands for Floppy Drive.
- 1 stands for HardDisk.
- 2 stands for CDROM.
- 3 stands for RAMDISK.
- 4 for network drives.
- 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)
(Becausea
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).