OnCmdUIContextChanged Method
Collapse the table of content
Expand the table of content
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

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)

int OnCmdUIContextChanged(
	uint dwCmdUICookie,
	int fActive


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.

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.

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.

© 2015 Microsoft