Use this class to display a context menu for a shell item, either as a popup menu, or as a main menu.
To display a popup menu, simply call ShowContextMenu(...)/> with the parent control and the position at which the menu should be shown.
To display a shell context menu in a Form's main menu, call the Populate method to populate the menu. In addition, you must intercept a number of special messages that will be sent to the menu's parent form. To do this, you must override Form.WndProc like so:
protected override void WndProc(ref Message m) { if ((m_ContextMenu == null) || (!m_ContextMenu.HandleMenuMessage(ref m))) { base.WndProc(ref m); } }
Where m_ContextMenu is the ShellContextMenu being shown.
Standard menu commands can also be invoked from this class, for example InvokeDelete and InvokeRename.