To add a shell icon, you can do the following:
First we create the shell icon.
-- Backup your Registry first.
In the windows registry, go to
HKEY_CLASSES_ROOT\CLSID
and make a new key named
{D46C1FE2-7F18-41D0-6250-848C1D003400}
This name is just an example, other names will work too. Just be sure not to use an existing name and to keep this format.
In the default value of this newly created key, you can put the name you wish to display under the icon. For example, "My test icon".
Create a string named
InfoTip
and enter some text you wish to display as tooltip when hovering the mouse over the icon.
Under your new key, make a sub key named
DefaultIcon
. Here you can set the default value to a filename for the icon to display. For example "C:\MyIcon.ico" or "C:\MyDll.dll,5".
Create the following sub keys:
Shell\Open\Command
and set the default value to whichever command you wish to execute when the icon is activated. For example "C:\windows\notepad.exe".
You should now have this:
HKEY_CLASSES_ROOT\CLSID
\{D46C1FE2-7F18-41D0-6250-848C1D003400}
(default) = "My test icon"
InfoTip = "My info tip"
\DefaultIcon
(default) = "C:\MyIcon.ico"
\Shell
\Open
\Command
(default) = "C:\windows\notepad.exe"
At this point, the shell icon is ready and will have to be added to a place where you can see it.
Go to
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Desktop
and add a key
NameSpace
. It may already exist.
Under
NameSpace
, create a key named
{D46C1FE2-7F18-41D0-6250-848C1D003400}
.
If you wish to create the icon in the My Computer window rather than on the desktop, you could do the same in
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace
.
If you want to change the shell icon depending on net connection, you'll have to write a program that monitors the connection and adjusts the shell icon accordingly in the windows register, for example by removing it from the NameSpace.