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
‘선언
Function ShowContextMenu ( _
dwCompRole As UInteger, _
ByRef rclsidActive As Guid, _
nMenuId As Integer, _
pos As POINTS(), _
pCmdTrgtActive As IOleCommandTarget _
) As Integer
‘사용 방법
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
)
abstract ShowContextMenu :
dwCompRole:uint32 *
rclsidActive:Guid byref *
nMenuId:int *
pos:POINTS[] *
pCmdTrgtActive:IOleCommandTarget -> int
function ShowContextMenu(
dwCompRole : uint,
rclsidActive : Guid,
nMenuId : int,
pos : POINTS[],
pCmdTrgtActive : IOleCommandTarget
) : int
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 nulla null reference (Nothing in Visual Basic).
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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.