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.
Now let me explain the working of each function.
-
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.