Click or drag to resize

ShellContextMenuProvider Class

Class providing the explorer context menu. It is used by ShellBrowser internally, but can is publicly available to either show the system context menu for a file or a list of files (ShowContextMenu(Int32, Int32, ShellContextMenuOptions)) or to execute command from the menu (ExecuteCommand(ShellCommand)).
Inheritance Hierarchy
SystemObject
  Jam.ShellWin32ShellContextMenuProvider
    Jam.ShellShellContextMenuProvider

Namespace: Jam.Shell
Assembly: ShellBrowser (in ShellBrowser.dll) Version: 7.2
Syntax
public class ShellContextMenuProvider : Win32ShellContextMenuProvider, 
	IDisposable

The ShellContextMenuProvider type exposes the following members.

Constructors
 NameDescription
Public methodShellContextMenuProvider(ItemIdList)Creates a context menu for the passed ItemIdList.
Public methodShellContextMenuProvider(JamItemIdListCollection) Creates a context menu for the passed JamItemIdListCollection.
Top
Properties
 NameDescription
Public propertyAsyncOperationGets or sets a value indicating whether context menu operations are executed asynchronously.
(Inherited from Win32ShellContextMenuProvider)
Public propertyCustomMenuStripSets the custom menu strip.
Protected propertyShellMenuStartsAtGets or sets a position of the first item of the shell menu.
(Inherited from Win32ShellContextMenuProvider)
Public propertyShowShellContextMenuOnTop Defines the order of ShellContextMenu and CustomMenuStrip.
Public propertySourceItemsGets or sets source items.
(Inherited from Win32ShellContextMenuProvider)
Top
Methods
 NameDescription
Protected methodCreatePopupMenuCreates popup menu.
(Overrides Win32ShellContextMenuProviderCreatePopupMenu)
Public methodDisposePerforms application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Protected methodDispose(Boolean)Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Public methodExecuteCommand(ShellCommand)Executes the command operation on the SourceItems .
(Inherited from Win32ShellContextMenuProvider)
Public methodExecuteCommand(ShellContextMenuCommand) Executes the command operation on the SourceItems.
(Inherited from Win32ShellContextMenuProvider)
Obsolete
Protected methodHandleMenuItemHandles the menu item described by pCommandId.
(Overrides Win32ShellContextMenuProviderHandleMenuItem(Int32))
Protected methodOnAfterCommandExecuteExecutes the AfterCommandExecute event.
(Inherited from Win32ShellContextMenuProvider)
Protected methodOnBeforeCommandExecuteExecutes the BeforeCommandExecute event.
(Inherited from Win32ShellContextMenuProvider)
Protected methodOnRenameItemSelected Fires the RenameItemSelected event
(Inherited from Win32ShellContextMenuProvider)
Protected methodReleaseReleases this object.
(Inherited from Win32ShellContextMenuProvider)
Public methodShowContextMenu Shows the context menu at the specified location and executes the menu item the user has chosen.
(Inherited from Win32ShellContextMenuProvider)
Top
Events
 NameDescription
Public eventAfterCommandExecute This event is fired after a command that was selected from the context menu or passed to ExecuteCommand(ShellContextMenuCommand) is processed.
(Inherited from Win32ShellContextMenuProvider)
Public eventBeforeCommandExecute This event is fired before a command that was selected from the context menu or passed to ExecuteCommand(ShellContextMenuCommand) is processed.
(Inherited from Win32ShellContextMenuProvider)
Public eventRenameItemSelected This event is fired when the context menu option "Rename" is selected from the context menu or passed to ExecuteCommand(ShellContextMenuCommand).
(Inherited from Win32ShellContextMenuProvider)
Top
Example
Showing the context menu for the Windows folder.
C#
using (ShellContextMenuProvider lContextMenu = new ShellContextMenuProvider(new ItemIdList(@"c:\windows")))
{
    lContextMenu.ShowContextMenu(100, 100, ShellContextMenuOptions.Extended);
}
See Also