Newsflash

Add your items to Windows Explorer context menu - it never was easier: Windows Explorer Context Menu v6.83 was released

Read more...
 

Full Vista support appended

Read more...
 
Home arrow Archive arrow Add items to Explorer context menu - How?
Add items to Explorer context menu - How? PDF Print E-mail
Windows Explorer Context Menu Programming Considerations

This section discusses programming considerations related to windows explorer context menus.

    * Keyboard Access to Windows Explorer Context Menus
    * Windows Explorer Context Menu Creation
    * Windows Explorer Context Menu Destruction
    * Messages Used with Windows Explorer Context Menus
    * Windows Explorer Context Menu Modifications

Add an item to Explorer context menu easily – How ?

 

 

 Add an item to Explorer Shell context menu with Windows Explorer Shell Context Menu

 

  Add items to Windows Explorer Shell context menu easily with Windows Explorer 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 Windows Explorer Shell context menu. It and Visual Basic .NET support include detailed C# and 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 computer (all operating systems are supported – Windows XP, Vista, Windows x64 of all types , etc.)
  • Add items to Windows Explorer context menu to be shown in any way - with your custom caption and icon, as separator or sub-menu
  • Add your items 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 .DOC , .MP3,.WMA,.AAC , .AVI files)
  • Add your program items to Windows Explorer Shell context menu, sub-menus, sub-menus of unlimited depth and add to Explorer context menu entries of all types


Windows Explorer Shell Context Menu - is a .Net framework component that support all you may need to add your program items to Windows Explorer Shell context menu - in a fast and a very easy way. Add all your program items to Windows Explorer Shell context menu right now – add entries to context menu fast , easy and exactly as you want :

 Add an item To the Windows Explorer Context Menus easily with Explorer Context Menu

 

Add items to Explorer context menu - How?

The easiest way to add an item to Explorer context menu is to use a special .Net component that support your favorite programming language - C#, VB.NET, Java, etc. You should use Windows Explorer Context Menu. This.Net component (support C#, VB.NET, etc.) will add your items to Windows Explorer context menu in a fiew mouse clicks. It support all you may need, including unlimited-depth context menus. Add Items to Windows Explorer context menu - fast and easy ? Then you need Windows Explorer Context Menu. This .Net component will add all your custom items to Windows Explorer Shell context menu - automatically. All is supported (.Net, C#, VB.Net, C++, Java, CLR, etc.) ~ Add items to Windows Explorer Shell context menu on-the-fly ~ Add items with your icon and caption to Windows Explorer Shell context menu ~ Add to Explorer context menu items (entries) of all types.

Key features:

 ~ Add items to Windows Explorer context menu
(all your items will be appended to Windows Explorer context menu)
 ~ Add items to Windows Explorer context menu - Easily
(just write two sample lines of code - and all your items
will be appended to Windows Explorer context menu)
 ~ Add items to Windows Explorer context menu - Using ANY Language
(C#, VB.Net, Java, C++, .Net, any CLR language - all your items will be appended
to Windows Explorer Shell context menu in a few minutes)
 ~ Add items with custom icons, custom captions, inside of custom sub-menus
to Windows Explorer Shell context menu
(all your custom items with your icon, your caption and your command
will be appended to context menu of Windows Explorer Shell - in a few minutes)
 ~ Your custom items, appended to Explorer context menu, are shown on any OS
(Windows XP, Windows Vista of all types and versions and all newer operation systems -
with Windows Explorer Context Menu all your items will be shown on any computer)
 ~ Add items (add entries) to Explorer Context Menu and even much more
(appending of custom menu items of all types - simple, with icon, disabled and enabled,
in unlimited-deep sub-menus and just shown in context menu root - with Explorer Context
Menu all is supported)

Add custom Items to Explorer Context Menu ? Then you need Explorer Context Menu. More info and free download at Windows-Menu.com

Download Windows Explorer Context Menu - and ADD Your Items to Context Menu right now!

 

Keyboard Access to Windows Explorer Context Menus

The system provides a standard keyboard interface for windows explorer context menus. You can enhance this interface by providing mnemonic access keys and shortcut (accelerator) keys for your windows explorer context menu items.

The following topics describe the standard keyboard interface, access keys, and shortcut keys:

    * Standard Keyboard Interface
    * Windows Explorer Context Menu Access Keys
    * Windows Explorer Context Menu Shortcut Keys


Standard Keyboard Interface

The system is designed to work with or without a mouse or other pointing device. Because the system provides a standard keyboard interface, the user can use the keyboard to select windows explorer context menu items. This keyboard interface does not need special code. An application receives a command message whether the user selects a windows explorer context menu item through the keyboard or by using a mouse. The standard keyboard interface processes the following keystrokes.

Alphabetical character  -  Selects the first windows explorer context menu item with the specified character as its access key. If the selected item invokes a windows explorer context menu, the windows explorer context menu is displayed and the first item is highlighted. Otherwise, the windows explorer context menu item is chosen.
ALT  -  Toggles in and out of windows explorer context menu bar mode.
ALT+SPACEBAR  -  Displays the window windows explorer context menu.
ENTER  -  Activates a windows explorer context menu and selects the first windows explorer context menu item if an item has a windows explorer context menu associated with it. Otherwise, this keystroke chooses the item as if the user released the mouse button while the item was selected.
ESC -   Exits windows explorer context menu mode.
LEFT ARROW  -  Cycles to the previous top-level windows explorer context menu item. Top-level windows explorer context menu items include windows explorer context menu names and the window windows explorer context menu. If the selected item is in a windows explorer context menu, the previous column in the windows explorer context menu is selected or the previous top-level windows explorer context menu item is selected.
RIGHT ARROW  -  Works like the LEFT ARROW key, except in the opposite direction. In windows explorer context menus, this keystroke moves forward one column; when the currently selected item is in the far-right column, the next windows explorer context menu is selected.
UP or DOWN ARROWS  -  Activates a windows explorer context menu when pressed in a windows explorer context menu name. When pressed in a windows explorer context menu, the UP ARROW keystroke selects the previous item; the DOWN ARROW keystroke selects the next item.


Windows Explorer Context Menu Access Keys

The standard keyboard interface for windows explorer context menus can be enhanced by adding access keys (mnemonics) to windows explorer context menu items. An access key is an underlined letter in the text of a windows explorer context menu item. When a windows explorer context menu is active, the user can select a windows explorer context menu item by pressing the key that corresponds to the item's underlined letter. The user makes the windows explorer context menu bar active by pressing the ALT key to highlight the first item on the windows explorer context menu bar. A windows explorer context menu is active when it is displayed.

To create an access key for a windows explorer context menu item, precede any character in the item's text string with an ampersand. For example, the text string "&Move" causes the system to underline the letter "M".


Windows Explorer Context Menu Shortcut Keys

In addition to having an access key, a windows explorer context menu item can have a shortcut key associated with it. A shortcut key is different from an access key, because the windows explorer context menu does not have to be active for the shortcut key to work. Also, an access key is always associated with a windows explorer context menu item, while an shortcut key is usually (but does not have to be) associated with a windows explorer context menu item.

Text that identifies the shortcut key is added to the windows explorer context menu-item text string. The shortcut text appears to the right of the windows explorer context menu item name, after a backslash and tab character (\t). For example, "&Close\tAlt+F4" represents a Close command with the ALT+F4 key combination as its shortcut key and with the letter "C" as its access key. For more information, see Keyboard Accelerators.


Windows Explorer Context Menu Creation

You can create a windows explorer context menu using either a windows explorer context menu template or windows explorer context menu creation functions. Windows Explorer Context Menu templates are typically defined as resources. Windows Explorer Context Menu-template resources can be loaded explicitly or assigned as the default windows explorer context menu for a window class. You can also create windows explorer context menu-template resources dynamically in memory.

The following topics describe windows explorer context menu creation in detail:

    * Windows Explorer Context Menu Template Resources
    * Windows Explorer Context Menu Template in Memory
    * Windows Explorer Context Menu Creation Functions
    * Windows Explorer Context Menu Display
    * Window Class Windows Explorer Context Menus



Windows Explorer Context Menu Template Resources

Most applications create windows explorer context menus using windows explorer context menu-template resources. A windows explorer context menu template defines a windows explorer context menu, including the items in the windows explorer context menu bar and all windows explorer context menus. For information about creating a windows explorer context menu-template resource, see the documentation included with your development tools.

After you create a windows explorer context menu-template resource and add it to your application's executable (.exe) file, you can use the LoadWindows Explorer Context Menu function to load the resource into memory. This function returns a handle to the windows explorer context menu, which you can then assign to a window by using the SetWindows Explorer Context Menu function. You can assign a windows explorer context menu to any window that is not a child window.

Implementing windows explorer context menus as resources makes an application easier to localize for use in multiple countries/regions. Only the resource-definition file needs to be localized for each language, not the application's source code.


Windows Explorer Context Menu Template in Memory

A windows explorer context menu can be created from a windows explorer context menu template that is built in memory at run time. For example, an application that allows a user to customize its windows explorer context menu might create a windows explorer context menu template in memory based on the user's preferences. The application could then save the template in a file or in the registry for future use. To create a windows explorer context menu from a template in memory, use the LoadWindows Explorer Context MenuIndirect function. For descriptions of windows explorer context menu-template formats, see Windows Explorer Context Menu Template Resources.

A standard windows explorer context menu template consists of a MENUITEMTEMPLATEHEADER structure followed by one or more MENUITEMTEMPLATE structures.

An extended windows explorer context menu template consists of a MENUEX_TEMPLATE_HEADER structure followed by one or more MENUEX_TEMPLATE_ITEM structures.
Windows Explorer Context Menu Creation Functions

Using windows explorer context menu creation functions, you can create windows explorer context menus at run time or add windows explorer context menu items to existing windows explorer context menus. You can use the CreateWindows Explorer Context Menu function to create an empty windows explorer context menu bar and the CreatePopupWindows Explorer Context Menu function to create an empty windows explorer context menu. You can save certain settings information for a windows explorer context menu by using the MENUINFO structure. To get or retrieve the settings of a windows explorer context menu, use GetWindows Explorer Context MenuInfo or SetWindows Explorer Context MenuInfo. To add items to a windows explorer context menu, use the InsertWindows Explorer Context MenuItem function. The older AppendWindows Explorer Context Menu and InsertWindows Explorer Context Menu functions are still supported, but InsertWindows Explorer Context MenuItem should be used for new applications.


Windows Explorer Context Menu Display

After a windows explorer context menu has been loaded or created, it must be assigned to a window before the system can display it. You can assign a windows explorer context menu by defining a class windows explorer context menu. For more information, see Window Class Windows Explorer Context Menus. You can also assign a windows explorer context menu to a window by specifying a handle to the windows explorer context menu as the hWindows Explorer Context Menu parameter of the CreateWindow or CreateWindowEx function, or by calling the SetWindows Explorer Context Menu function.

To display a shortcut windows explorer context menu use the TrackPopupWindows Explorer Context MenuEx function. Shortcut windows explorer context menus, also called floating pop-up windows explorer context menus or context windows explorer context menus, are typically displayed when the WM_CONTEXTMENU message is processed.

You can assign a windows explorer context menu to any window that is not a child window.

The older TrackPopupWindows Explorer Context Menu function is still supported, but new applications should use the TrackPopupWindows Explorer Context MenuEx function.
Window Class Windows Explorer Context Menus

You can specify a default windows explorer context menu, called a class windows explorer context menu, when you register a window class. To do so, you assign the name of the windows explorer context menu-template resource to the lpszWindows Explorer Context MenuName member of the WNDCLASS structure used to register the class.

By default, every window is assigned the class windows explorer context menu for its window class so you do not need to explicitly load the windows explorer context menu and assign it to each window. You can override the class windows explorer context menu by specifying a different windows explorer context menu handle in a call to the CreateWindowEx function. You can also change a window's windows explorer context menu after it is created by using the SetWindows Explorer Context Menu function. For more information, see Window Classes.
Windows Explorer Context Menu Destruction

If a windows explorer context menu is assigned to a window and that window is destroyed, the system automatically destroys the windows explorer context menu and its subwindows explorer context menus, freeing the windows explorer context menu's handle and the memory occupied by the windows explorer context menu. The system does not automatically destroy a windows explorer context menu that is not assigned to a window. An application must destroy the unassigned windows explorer context menu by calling the DestroyWindows Explorer Context Menu function. Otherwise, the windows explorer context menu continues to exist in memory even after the application closes. To end the calling thread's active windows explorer context menu, use EndWindows Explorer Context Menu. If a platform does not support EndWindows Explorer Context Menu, send the owner of the active windows explorer context menu a WM_CANCELMODE message.


Messages Used with Windows Explorer Context Menus

The system reports windows explorer context menu-related activity by sending messages to the window procedure of the window that owns the windows explorer context menu. The system sends a series of messages when the user selects items on the windows explorer context menu bar or clicks the right mouse button to display a shortcut windows explorer context menu.

When the user activates an item on the windows explorer context menu bar, the owner window first receives a WM_SYSCOMMAND message. This message includes a flag that indicates whether the user activated the windows explorer context menu by using the keyboard (SC_KEYMENU) or the mouse (SC_MOUSEMENU). For more information, see Keyboard Access to Windows Explorer Context Menus.

Next, before displaying any windows explorer context menus, the system sends the WM_INITMENU message to the window procedure so that an application can modify the windows explorer context menus before the user sees them. The system sends the WM_INITMENU message only once per windows explorer context menu activation.

When the user points to a windows explorer context menu item that opens a subwindows explorer context menu, the system sends the owner window the WM_INITMENUPOPUP message before displaying the subwindows explorer context menu. This message gives the application an opportunity to modify the subwindows explorer context menu before it is displayed.

Each time the user moves the highlighting from one item to another, the system sends a WM_MENUSELECT message to the window procedure of the windows explorer context menu's owner window. This message identifies the currently selected windows explorer context menu item. Many applications provide an information area at the bottom of their main windows and use this message to display additional information about the selected windows explorer context menu item.

When the user chooses a command item from a windows explorer context menu, the system sends a WM_COMMAND message to the window procedure. The low-order word of the WM_COMMAND message's wParam parameter contains the identifier of the chosen item. The window procedure should examine the identifier and process the message accordingly.

You can save information for a windows explorer context menu using the MENUINFO structure. If the windows explorer context menu is defined with a MENUINFO.dwStyle value of MNS_NOTIFYBYPOS, the system sends WM_MENUCOMMAND instead of the WM_COMMAND when an item is selected. This allows you to access the information in the MENUINFO structure and also provides the index of the selected item directly.

Not all windows explorer context menus are accessible through a window's windows explorer context menu bar. Many applications display shortcut windows explorer context menus when the user clicks the right mouse button at a specific location. Such applications should process the WM_CONTEXTMENU message and display a shortcut windows explorer context menu, if appropriate. If an application does not display a shortcut windows explorer context menu, it should pass the WM_CONTEXTMENU message to the DefWindowProc function for default processing.

The WM_MENURBUTTONUP message is sent when the user releases the right mouse button while the cursor is on a windows explorer context menu item. This message is provided so that applications can display a context-sensitive or shortcut windows explorer context menu for a windows explorer context menu item.

There are a few messages that only involve drag-and-drop windows explorer context menus. The WM_MENUGETOBJECT is sent to the owner of a drag-and-drop windows explorer context menu when the mouse cursor enters a windows explorer context menu item or moves from the center of an item to the top or the bottom of an item. The WM_MENUDRAG message is sent when the user actually drags a windows explorer context menu item.

When a drop-down windows explorer context menu or a subwindows explorer context menu has been destroyed, the system sends a WM_UNINITMENUPOPUP message.


Windows Explorer Context Menu Modifications

Several functions enable you to change a windows explorer context menu after it has been loaded or created. These changes may include adding or removing windows explorer context menu items and modifying existing windows explorer context menu items.

To add a windows explorer context menu item, use the InsertWindows Explorer Context MenuItem function. You can use the SetWindows Explorer Context MenuItemInfo function to change the attributes of an existing windows explorer context menu item. The lpmii parameter is a pointer to a MENUITEMINFO structure, which contains the new attributes and specifies which attributes to change. A windows explorer context menu item's attributes include its type, state, identifier, subwindows explorer context menu, bitmaps, item data, and text.

The older AppendWindows Explorer Context Menu and InsertWindows Explorer Context Menu functions can also be used to add windows explorer context menu items, but new applications should use InsertWindows Explorer Context MenuItem. The AppendWindows Explorer Context Menu function appends a windows explorer context menu item to the end of a windows explorer context menu or subwindows explorer context menu; the InsertWindows Explorer Context Menu function inserts a windows explorer context menu item at a specified position in a windows explorer context menu or subwindows explorer context menu. Both functions permit the attributes of the windows explorer context menu item to be specified, including whether the windows explorer context menu item is enabled, disabled, grayed, selected, or cleared.

To change the appearance or attributes of an existing windows explorer context menu item, use the ModifyWindows Explorer Context Menu function. For example, the text string or bitmap of a windows explorer context menu item can be enabled, disabled, grayed, selected, or cleared. The ModifyWindows Explorer Context Menu function replaces the specified windows explorer context menu item with a new item.

To retrieve information about a windows explorer context menu item, use the GetWindows Explorer Context MenuItemInfo function. The lpmii parameter is a pointer to a MENUITEMINFO structure, which specifies the attributes to retrieve and receives their current values.

To delete a windows explorer context menu item from a windows explorer context menu, use the DeleteWindows Explorer Context Menu or RemoveWindows Explorer Context Menu function. If the item being deleted is one that opens a subwindows explorer context menu, DeleteWindows Explorer Context Menu deletes the associated subwindows explorer context menu, discarding the windows explorer context menu handle and freeing the memory used by the subwindows explorer context menu. The RemoveWindows Explorer Context Menu function deletes a windows explorer context menu item, but if the item opens a subwindows explorer context menu, the function does not destroy the subwindows explorer context menu or its handle, allowing the subwindows explorer context menu to be reused.

To redraw the windows explorer context menu bar after a windows explorer context menu bar has been modified, use the DrawWindows Explorer Context MenuBar function. Otherwise, the modifications will not appear until the system redraws the owner window.

 
< Prev   Next >
© 2012 Add items to Windows Context Menu - easily with Windows Explorer Context Menu (.Net Component)
All product and company names are trademarks or registered trademarks of their respective owners.