|
Windows Explorer Shell context menu and Windows Explorer Windows Explorer Shell context menu makes Windows Explorer add-on development quick and easy. It implements everything required by the Windows Explorer API; you focus on the applied code only. Using visual designers of Windows Explorer Shell context menu you can add a custom button to the Windows Explorer toolbar, build a custom Explorer bar, context menu item, or pop-up item, or add a command to the Windows Explorer interface with a few clicks. Just follow the steps below and you will see that the development of Windows Explorer plug-ins with Windows Explorer Shell context menu can be something you can enjoy. You may want to download a sample Windows Explorer add-on with source code.
Add items to Explorer context (right-click) menu easily – How ? Insert items to Windows Explorer context menu easily with Explorer Shell Context Menu. This powerful .Net component for your own, custom items adding to Windows Explorer Shell context menu will add all your custom application entries to the Explorer context menu. This .Net component , C++ and VB.NET support include detailed C# / VB.NET samples, tutorials , user-friendly manuals and support all you may need to add your items to context menu : - Add items to Windows Explorer Shell context menu to be shown on any Windows operating system (all OS are supported – Windows XP, Vista, Windows x64 , etc.)
- Add any type of items to Windows Explorer Shell context menu to be shown in any way - with custom caption and your custom icon, as separator or sub-menu
- Add items of any types to Windows Explorer Shell context menu to be shown for all types of files or shown only for computer files of particular type (for example, only for .PDF .TXT , .MP3,.WMA,.AAC , .AVI files)
- Add your program entries to Windows Explorer Shell context menu, sub-menus, sub-menus of unlimited depth and even much more
Windows Explorer Shell Context Menu - is a powerful .Net component that support all you may need to add all your program items to the Windows Explorer Shell context menu - in a fast and a very easy way. Add your entries to Windows Explorer Shell context menu right now – add entries to context menu fast and exactly as you want :
1. Create a new Windows Explorer add-on solution
Custom items appending to Windows Explorer Shell context menu shell method, described in this articele about Windows Explorer Shell context menu for Windows 95 / Windows 98 (not for XP, Vista, x64 - 64-bit Windows), so to add items to Windows Explorer Shell context menu you should use, according to Microsoft guidelines, appropriate .Net component - Explorer Context Menu. To add utems to context of Windows Explorer download and install this .Net component. In your Visual Studio IDE, run the Windows Explorer Shell context menu Windows Explorer Add-on wizard located in the "Other Projects | Extensibility Projects" item of the "New Project" dialog box.
Windows Explorer add-on project wizard in Visual Studio
Then, choose the programming language for your add-on solution (it is VB.NET in our Browser extension project; but Visual C#, C++ and RO Chrome are also available) and click Finish.
Windows Explorer add-on project settings
The wizard creates an Windows Explorer add-on solution that consists of two projects: the add-on project itself and its setup project used for add-on deployment. 2. The Windows Explorer Module
The main element of the Windows Explorer add-on project is the Windows Explorer Module, it is the "heart" of your add-on (see the picture below).
First, the Windows Explorer Module is a descendant of the ADXWindows ExplorerModule class - the ancestor of any Windows Explorer add-on - that implements required COM-interfaces, registration and deployment features, etc. In addition, the Windows Explorer Module serves as a container for any other components such as datasets and data binding sources. You can also add the Keyboard Shortcut component using the context menu of the module's designer window. Finally, you concentrate your work around this module since it is a browser helper object that provides "access points" for handling Windows Explorer objects. All in all, this RAD module is the place where your write your applied code.
Windows Explorer module designer
Several Windows Explorer Module properties available at design-time are important for you, namely:
* Commands - a collection of commands you add to Windows Explorer. * ContextMenu - a collection of pop-up menu items for all Windows Explorer context. * Bars - a collection each item of which makes an appropriate .NET user control a custom Explorer bar. * Toolbars - a collection each item of which makes an appropriated .NET user control a custom Windows Explorer toolbar. * HandleShortcuts - enables custom keyboard shortcuts for your add-on. * LoadBehavior - loads your add-on at Windows Explorer startup or on demand.
3. Adding custom commands in Windows Explorer
To add a custom command to the Windows Explorer user interface, you use the Commands collection of the Windows Explorer Module.
Creating a command for Windows Explorer
Its visual designer allows you to add and sort out your custom commands and customize their properties at design-time. The properties are:
* ActiveIcon and InactiveIcon - active and inactive command icons; the icons must be located in the Resources folder of your add-on project; these properties are required if ShowInToolbar is true. * Caption - the caption text for your command. * HelpText - the help text for your command. * ShowInMenu - shows your command in the Tools or Help menu of Windows Explorer or disables showing. * ShowInToolbar - places your command on the built-in toolbar of Windows Explorer.
The properties suggest that a command can be shown in the Windows Explorer toolbar and / or in the Windows Explorer menu:
* To show the command on the built-in Windows Explorer toolbar, set the ShowInToolBar property to True. Note that the ActiveIcon and InactiveIcon properties are required in this case. That's why Windows Explorer Shell context menu for Windows Explorer provides two sample icons when generating an Windows Explorer add-on project; you can find them in the Resources folder of your project. * To show the command in the Windows Explorer menu, you use the ShowInMenu property; it provides Tools, Help and Don't Show self-explanatory values.
The only event provided by the command is OnClick. 4. Building custom context menu items in Windows Explorer
To add a custom context menu item to some or all Windows Explorer Shell context menus (pop-up menus), you use the ContextMenu collection of your Windows Explorer Module.
Creating a context menu item
The visual designer of the ContextMenu collection (see the picture above) allows you to add new context menu items at design-time. For every item, you specify the caption and contexts where the context menu item will be shown.
The only event provided by the context menu command is OnClick.
5. Creating custom Windows Explorer toolbars
Windows Explorer Shell context menu for Windows Explorer contains a special component that you use to build a custom Windows Explorer toolbar. The first step to add a custom toolbar to Windows Explorer is to add an instance of the component to your add-on project; you can find the component in the Add New Item dialog of the add-on project.
Windows Explorer Toolbar control
This component, of the AddinExpress.Windows Explorer.ADXWindows ExplorerToolBar type, derived from UserControl is a ready-to-use custom toolbar in Windows Explorer. In its context menu, you can find the Add Keyboard Shortcut command, add the Keyboard Shortcut component to your Windows Explorer toolbar and make sure that the HandleShortcuts property of the toolbar is set to true (see the picture below). You can add any .NET control onto the toolbar by just using the Toolbox in the Visual Studio IDE.
Designing the Windows Explorer toolbar
Now, when the toolbar itself is prepared, you go on to the second step: add an item to the ToolBars collection of the Windows Explorer module, bind the item to the toolbar and set the remaining properties of the item (see below).
Binding the Windows Explorer toolbar to the add-on
Here are the properties of an AdxieToolBarItem:
* LoadAtStartUp - when false, the toolbar is not shown; the user has to check the View | Toolbars | %MenuText% item in the Windows Explorer menu. * MenuText - the caption of the item is in the View | Toolbars menu; this menu item controls the visibility of the toolbar. * NoGripper - when true, the user cannot change the position of the Windows Explorer toolbar. * Position - there are two values available: Default - Windows Explorer decides where to show the toolbar, and NewRow which is self-explanatory, isn't it? * Title - if it is a non-empty string, it will be shown on the toolbar. * ToolbarType - binds the item to the toolbar component.
Also note that AddinExpress.Windows Explorer.ADXWindows ExplorerToolBar provides all Windows Explorer events, see a complete list of available Windows Explorer events. Event handling is described below.
See also how to add a button and menu item to Windows Explorer toolbar.
6. Developing custom Explorer bars
The Windows Explorer SDK allows adding custom Explorer bars. In the Windows Explorer UI, the menu items that control the visibility of such bars are located in the View | Explorer Bar | %MenuText% menu. With Windows Explorer Shell context menu, Windows Explorer bars can be created in two logical steps: you build a bar itself, and then you specify its settings.
To make an Explorer bar, you choose the Windows Explorer Shell context menu Windows Explorer Bar item template in the Add New Item dialog (see the picture below) and click the Add button. Windows Explorer bar (Explorer bar) control
This adds a new class to your Windows Explorer add-on project. This class, derived from UserControl and named AddinExpress.Windows Explorer.ADXWindows ExplorerBar, is just an empty Explorer bar. Now, you can use standard Visual Studio tools to create UI and business logics of your Explorer bar. Note that in its context menu, it provides the Add Keyboard Shortcut command; you use the command to add an appropriate component to your bar.
Designing the Windows Explorer bar control
The final step of creating a custom Explorer bar is to tune it. You add an item to the Bars collection of the Windows Explorer module. This item binds the Explorer bar component to a number of settings shown below. The settings allow specifying startup behaviour, docking position, size restrictions and text properties related to the visualization of the Explorer bar: caption, menu title, and text to be shown in the Status bar. They also describe the button associated with the Explorer bar that can be shown on the built-in Windows Explorer toolbar. The most important property is BarType: it binds the Windows Explorer bar to the item of the Bars collection. More about creating custom Explorer bars.
7. Handling Windows Explorer events
Windows Explorer Shell context menu for Windows Explorer delivers all Windows Explorer events in the Windows Explorer module, ADXWindows ExplorerBar and ADXWindows ExplorerToolBar components. Naturally, you use them like you use any other events in .NET: create an event handler and write your code. Note that the list of events contains some Windows Explorer 7-specific events; clearly, they will not be triggered when the add-ion is loaded by Windows Explorer 6.
Windows Explorer module provides all Windows Explorer events.
Windows Explorer events are listed and described in WebBrowser Control Events on MSDN.
8. Building, registering and running your Windows Explorer add-on
Close all Windows Explorer instances and build your Windows Explorer add-on. If the add-on isn't registered yet, register it (see the Register Windows Explorer Shell context menu Project command in the Build menu of the VS IDE). Now you can run Windows Explorer and see your add-on in action.
To debug your add-on, specify Windows Explorerxplore,exe (on my PC, C:\Program Files\Windows Explorer\iexplore.exe) in the Start External Program property of your add-on project and run the project. 9. Deploying your Windows Explorer add-on
To deploy your add-on, build the setup project and deliver its output to the end-user. Please note, that administrative privileges are required for the add-in to install. More about Windows Explorer add-on deployment.
See Also
* Developing Windows Explorer add-ons, toolbars in C#, VB.NET, C++ * Building Windows Explorer add-on based on Windows Explorer API * Create Windows Explorer BHO based on Windows Explorer SDK * Designers for creating Windows Explorer add-on, Explorer bar, commands * Windows Explorer add-on deployment and integration * Windows Explorer Shell context menu for Windows Explorer requirements * Windows Explorer Shell context menu for Windows Explorer feature matrix and prices |