Explorer of Windows 7 uses a new light-blue bar with buttons like "Organize", "Share", "New Folder" etc.
How can I create a new button ? Do I need to create a plugin for explorer.exe, and if, how do I do it (using Visual Studio .NET) ?
Or is it a simple registry key I have to set which points to an exe or bat?
Thanks in advance and best regards
It's a registry key, but not quite so simple. You have to do several steps to add one button.
You may have noticed that the Win7 Explorer adjusts its toolbar to match the content that is being displayed. For example the buttons shown for the control panel folders are different than the ones for documents or the music library folder. You can find a large list of different folder types under the registry key
Click on each UID shown there to find out what folder type it is for. For example here you see the entry for folders in the generic library type:
So the first thing you have to do is to find the folder type for which you want to add your own button.
Once you found the right UID, you might have to take ownership of those keys. Otherwise you won't be able to modify them: Right-click on that key and choose Permisssions...
Click Apply and verify that "Current Owner" is set to Administrators. Click OK to save the change.
The next step is to create the keys and values necessary for your own button:
TasksItemsSelected
TasksItemsSelected\0
TasksItemsSelected\0\<yourguid>
, then add the stringsTitle
andInfoTip
and give them the appropriate values. You can also set an icon here, using the stringIcon
with the value pointing to an icon file.TasksItemsSelected\0\<yourguid>\shell\InvokeTask\command
Now your registry entry should look something like this:
When the command runs, it will receive at least two parameter values.
If you select more than one file before clicking the mycommand button, then the subsequent filenames will be in subsequent parameters.
And last but not least: if you want to add your own button for situations where nothing is selected, do everything as mentioned above, but use the registry key
TasksNoItemsSelected
instead ofTasksItemsSelected