IVsUIShell::ShowContextMenu Method (UInt32, Guid, Int32, array<POINTS>^, IOleCommandTarget^)
Visual Studio 2015
Shows the context menu for the active menu object.
Assembly: Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)
int ShowContextMenu( unsigned int dwCompRole, [InAttribute] Guid% rclsidActive, int nMenuId, array<POINTS>^ pos, IOleCommandTarget^ pCmdTrgtActive )
Parameters
- dwCompRole
-
Type:
System::UInt32
[in] Do not use.
- rclsidActive
-
Type:
System::Guid
[in] Specifies the GUID of the context menu in the .ctc file.
- nMenuId
-
Type:
System::Int32
[in] Identifier of the context menu to show from the .ctc file.
- pos
-
Type:
array<Microsoft.VisualStudio.Shell.Interop::POINTS>^
[in] Specifies the position to place the context menu.
- pCmdTrgtActive
-
Type:
Microsoft.VisualStudio.OLE.Interop::IOleCommandTarget^
[in] Pointer to the IOleCommandTarget interface of the active menu object. Can be null.
Return Value
Type: System::Int32If the method succeeds, it returns S_OK. If it fails, it returns an error code.
From vsshell.idl:
HRESULT IVsUIShell::ShowContextMenu( [in] DWORD dwCompRole, [in] REFCLSID rclsidActive, [in] LONG nMenuId, [in] REFPOINTS pos, [in] IOleCommandTarget *pCmdTrgtActive );
All commands are routed first to the IOleCommandTarget passed in pCmdTrgtActive.
Show: