Udostępnij za pośrednictwem


IVsUIShell.ShowContextMenu Method

Shows the context menu for the active menu object.

Namespace:  Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)

Syntax

'Declaration
Function ShowContextMenu ( _
    dwCompRole As UInteger, _
    ByRef rclsidActive As Guid, _
    nMenuId As Integer, _
    pos As POINTS(), _
    pCmdTrgtActive As IOleCommandTarget _
) As Integer
'Usage
Dim instance As IVsUIShell 
Dim dwCompRole As UInteger 
Dim rclsidActive As Guid 
Dim nMenuId As Integer 
Dim pos As POINTS()
Dim pCmdTrgtActive As IOleCommandTarget 
Dim returnValue As Integer 

returnValue = instance.ShowContextMenu(dwCompRole, _
    rclsidActive, nMenuId, pos, pCmdTrgtActive)
int ShowContextMenu(
    uint dwCompRole,
    ref Guid rclsidActive,
    int nMenuId,
    POINTS[] pos,
    IOleCommandTarget pCmdTrgtActive
)
int ShowContextMenu(
    [InAttribute] unsigned int dwCompRole, 
    [InAttribute] Guid% rclsidActive, 
    [InAttribute] int nMenuId, 
    [InAttribute] array<POINTS>^ pos, 
    [InAttribute] IOleCommandTarget^ pCmdTrgtActive
)
function ShowContextMenu(
    dwCompRole : uint, 
    rclsidActive : Guid, 
    nMenuId : int, 
    pos : POINTS[], 
    pCmdTrgtActive : IOleCommandTarget
) : int

Parameters

  • 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.

Return Value

Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

COM Signature

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.

.NET Framework Security

See Also

Reference

IVsUIShell Interface

IVsUIShell Members

Microsoft.VisualStudio.Shell.Interop Namespace