Edit

Share via


Shortcut Menu Reference

This topic lists the main programming elements used with shortcut (context) menus, and shortcut menu handlers. Shortcut menu handlers, which also known as context menu handlers or verb handlers, are a type of file type handler.

About Shortcut Menu Implementation

It is strongly encouraged that you implement a shortcut menu using one of the static verb methods. Please review the following instructions:

Interfaces

Topic Contents
IContextMenu Exposes methods that either create or merge a shortcut menu associated with a Shell object.
IContextMenu2 Exposes methods that either create or merge a shortcut (context) menu associated with a Shell object. Extends IContextMenu by adding a method that allows client objects to handle messages associated with owner-drawn menu items.
IContextMenu3 Exposes methods that either create or merge a shortcut menu associated with a Shell object. Allows client objects to handle messages associated with owner-drawn menu items and extends IContextMenu2 by accepting a return value from that message handling.
IContextMenuCB Exposes a method that enables the callback of a context menu. For example, to add a shield icon to a menuItem that requires elevation.
IContextMenuSite Implemented by the default folder view created using SHCreateShellFolderView. An implementation of IContextMenuSite supports IContextMenu::QueryContextMenu, IContextMenu::InvokeCommand, and TrackPopupMenu and any message forwarding necessary for that function. IContextMenuSite typically updates the status bar as well.

 

Functions

Topic Contents
CDefFolderMenu_Create2 Creates a context menu for a selected group of file folder objects.
LPFNDFMCALLBACK Defines the prototype for the callback function that receives messages from the Shell's default context menu implementation.
SHCreateDefaultContextMenu Creates an object that represents the Shell's default context menu implementation.

 

Structures

Topic Contents
CMINVOKECOMMANDINFO Contains information needed by IContextMenu::InvokeCommand to invoke a shortcut menu command.
CMINVOKECOMMANDINFOEX Contains extended information about a shortcut menu command. This structure is an extended version of CMINVOKECOMMANDINFO that allows the use of Unicode values.
DEFCONTEXTMENU Contains context menu information used by SHCreateDefaultContextMenu.

 

Shortcut (Context) Menus and Shortcut Menu Handlers

Choosing a Static or Dynamic Verb for your Shortcut Menu

Verbs and File Associations

Best Practices for Shortcut Menu Handlers and Multiple Selection Verbs

Creating Shortcut Menu Handlers

Customizing a Shortcut Menu Using Dynamic Verbs