共用方式為


IVsSelectionEvents.OnCmdUIContextChanged(UInt32, Int32) Method

Definition

Reports that the command UI context has changed.

public:
 int OnCmdUIContextChanged(System::UInt32 dwCmdUICookie, int fActive);
public:
 int OnCmdUIContextChanged(unsigned int dwCmdUICookie, int fActive);
int OnCmdUIContextChanged(unsigned int dwCmdUICookie, int fActive);
public int OnCmdUIContextChanged (uint dwCmdUICookie, int fActive);
abstract member OnCmdUIContextChanged : uint32 * int -> int
Public Function OnCmdUIContextChanged (dwCmdUICookie As UInteger, fActive As Integer) As Integer

Parameters

dwCmdUICookie
UInt32

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

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

Returns

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.

Applies to