다음을 통해 공유


IVsSelectionEvents.OnCmdUIContextChanged Method

Reports that the command UI context has changed.

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

Syntax

‘선언
Function OnCmdUIContextChanged ( _
    dwCmdUICookie As UInteger, _
    fActive As Integer _
) As Integer
‘사용 방법
Dim instance As IVsSelectionEvents
Dim dwCmdUICookie As UInteger
Dim fActive As Integer
Dim returnValue As Integer

returnValue = instance.OnCmdUIContextChanged(dwCmdUICookie, _
    fActive)
int OnCmdUIContextChanged(
    uint dwCmdUICookie,
    int fActive
)
int OnCmdUIContextChanged(
    [InAttribute] unsigned int dwCmdUICookie, 
    [InAttribute] int fActive
)
function OnCmdUIContextChanged(
    dwCmdUICookie : uint, 
    fActive : int
) : int

Parameters

  • dwCmdUICookie
    Type: System.UInt32

    [in] DWORD representation of the GUID identifying the command UI context passed in as the rguidCmdUI parameter in the call to GetCmdUIContextCookie.

  • fActive
    Type: System.Int32

    [in] Flag that is set to true if the command UI context identified by dwCmdUICookie has become active and false if it has become inactive.

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 IVsSelectionEvents::OnCmdUIContextChanged(
   [in] VSCOOKIE dwCmdUICookie,
   [in] BOOL fActive
);

This method is called by the environment to notify registered VSPackages that a command UI context changed from a Boolean Off to On, or vice versa. Command UI contexts are monitored at the global level by the SVsShellMonitorSelection service. For example, when a command UI context is used to turn on debug mode, the environment notifies all registered VSPackages of this change in mode by calling IVsSelectionEvents::OnCmdUIContextChanged.

Permissions

See Also

Reference

IVsSelectionEvents Interface

IVsSelectionEvents Members

Microsoft.VisualStudio.Shell.Interop Namespace