Here,It my another Project, System Utility ver 1.0. let me explain it's functionality
Basically this whole program depends on the registry. The registry in Windows holds the key to each and every aspects of the Windows Operating System, but only if you find them in registry and use them.
Now , let us see how to manually Disable and Enable the drives using the keys in the Registry.
1.Disable/Enable Drives:
Using this Program:
* Just Check on the Restriction you want to apply and click apply, the restriction are applied.
* Remember most of restriction after applying and disapplying need Restarting of your computer ok.
Registry Class - CNMPDrivesClass
The Declaration of the Class is this ->
Now let me explain working of each function
1. void SendTypeOFDrives(CUIntArray &Stat);
Basically this whole program depends on the registry. The registry in Windows holds the key to each and every aspects of the Windows Operating System, but only if you find them in registry and use them.
Now , let us see how to manually Disable and Enable the drives using the keys in the Registry.
1.Disable/Enable Drives:
The key for the Number of drives in the registry is available at,2.Disable Control panel:
HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Policies\Explorer
The value 'NoDrives' :The value of this data will depend on the no of drives in your system.
Let us take an example. If you system contain 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'))).This is a little complicated. The DLL, I use contains the wrapper for this , so just use them.
The Key Holding data to Show or Hide Control Panel is3. Disable Change Password:
HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Policies\Explorer
and Value Name is "NoControlPanel" if it value is 0 you can see Control Panel and if 1 you can't see control panel.
This option you are going to see when u press (CTRL+ALT+DEL) in WIN2000 and above and its Key is4.Disable Search:
HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Policies\System
and Value Name is "DisableChangePassword" if its value is 0 you can see Change Password Option Enabled and if 1 ChangePassword Option is disabled.
This option you are going to see in Start menu and it Key is5.Disable RUN:
HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\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.
This option is available in Start menu and it Key is6.Disable ShutDown:
HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Policies\Explorer
and Value Name is "NoRun" if its value is 0 you can see this Option Enabled and if 1 you will not be able to see this Windows' Run program option.
This option is available in Start menu and it Key is7.Disable NetworkAccess:
HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\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.
This option is available on the Desktop and it Key is8.Disable TaskBar Setting:
HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Policies\Explorer
and Value Name is "NoNetHood" if its value is 0 you can see this Network Neighborhood icon and if 1 it will be invisible.
This option you are going to see at Desktop and it Key is9.Disable RegEdit:
HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\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.
This is Registry Editor tool10.Disable TaskManager:
HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Policies\System
and Value Name is "DisableRegistryTools" if it value is 0 you can see this Option Enabled and if 1 you can't see that option.
This option you are going to see usually in windows 2000 and above when you press (CTRL+ALT_DEL), its Key is11.Disable Context Menu:
HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\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.
This option you are going to see is accessible by a Right click on DESKTOP. This is what is known as Context menu and it Key is12. Disable Desktop icon:
HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Policies\Explorer
and Value Name is "NoViewContextMenu" if its value is 0 you can see this context menu and if 1 you can't see that option.
This option applies all the icon present on desktop ,it key is13.Disable Display Properties:
HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Policies\Explorer
and Value Name is "NoDesktop" if its value is 0 you can see this icons and if 1 all icons will be invisible.
This option you are going to see is accessible by a Right click on DESKTOP and click on Properties menu item and it Key is14.Disable Background Tab:
HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Policies\System.
The Value Name is "NoDispCPL" if its value is 0 you can see this Option Enabled and if 1 you can't see that option.
This option you are going to see in Display Control Panel and it Key is15.Disable ScreenSaver Tab:
HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Policies\System
Value Name is "NoDispBackgroundPage" if its value is 0 you can see this Option Enabled and if 1 you can't see that option.
This option you are going to see In Display Control Panel and it Key is16.Disable Setting And Plus Tab:
HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Policies\System
and Value Name is "NoDispScrSavPage" if its value is 0 you can see this Option Enabled and if 1 you can't see that option.
This option you are going to see In Display Control Panel and it Key is17.Disable Appearance Tab:
HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Policies\System
and Value Name is "NoDispSettingsPage" if its value is 0 you can see this Option Enabled and if 1 you can't see that option.
This option you are going to see In Display Contral Panel and it Key isI think I have explained all the functionalities of the program. Remember one thing. Some of these options show effect only when the computer is restarted.
HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Policies\System
and Value Name is "NoDispAppearancePage" if its value is 0 you can see this Option Enabled and if 1 you can't see that option.
Using this Program:
* Just Check on the Restriction you want to apply and click apply, the restriction are applied.
* Remember most of restriction after applying and disapplying need Restarting of your computer ok.
Registry Class - CNMPDrivesClass
The Declaration of the Class is this ->
Code: CPP
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 working of each function
1. void SendTypeOFDrives(CUIntArray &Stat);
This function fills the Types of Drives Present in the computer into an array of type CUIntArray. The values are filled according to Drives like If your computer has (A: C: D: E:), in the alphabetical order.2. void SendStatusOFDrives(CUIntArray &stat);
Array [0]:A: information
Array [1]:C: information
Array [2]:D: information
Array [3]:E: information
Meaning of Values in the CUIntArray:
* 0 stand for Floppy Drive
* 1 stand for Hard Disk
* 2 stand for CDRom
* 3 stand for RAMDISK
* 4 for network Drives
* 5 for Unknown or Can't be retrieve
This function will tell status of drives either it Enabled or disabled. This argument contains the Drives Int, which are disabled eg int(65) stand for A, int (66) for B and so on.3. BOOL GetDrivesVolume(CStringArray &VolumeName,CDWordArray SerialNumber,CStringArray &FileSystem);
Now let me explain this with small Example
Assume that the Computer had A:,C:,D:,E: Drives and C: and D: are disabled.
The size of returning Array Stat will be 2 and the values will be filled as follows.
Stat[0]=C
&Stat[1]=D
This function contains the information about Volume Name, Serial Number And File System of drives, and it Sequence is same as above.4.void NMPReturnNoOfDrives(CUIntArray &NoOfDrives);
Like if your computer has (A: C: D: E:)
Array [0]:A: information
Array [1]:C: information
Array [2]:D: information
Array [3]:E: information
This function returns the number of drives the local system contain, but it will return Integer equivalent of character.5. void NMPDisableLocalDrives(CUIntArray &a);
eg If your computer has (A: C: D: E:)
Array [0]:65 ie A (According to ASCII Character SET)
Array [1]:67 ie C (According to ASCII Character SET)
Array [2]:68 ie D (According to ASCII Character SET)
Array [3]:69:ie E (According to ASCII Character SET)
This function will Disable the local drives in the computer, but remember it erases the previous values before writing to it.Note-> The Attach Ment Includes The Application EXE
Now if you want to disable A: and C:, just ADD to a.Add(A),a.Add(C) (Because a is Array Class) and call the function.
NMPDisableLocalDrives(a);
And Voila after Restart the A: & C: are not Visible on Explorer.


