IVsMonitorSelection.IsCmdUIContextActive(UInt32, Int32) Method

Definition

Determines whether a specific command UI context is active.

public:
 int IsCmdUIContextActive(System::UInt32 dwCmdUICookie, [Runtime::InteropServices::Out] int % pfActive);
int IsCmdUIContextActive(unsigned int dwCmdUICookie, [Runtime::InteropServices::Out] int & pfActive);
public int IsCmdUIContextActive (uint dwCmdUICookie, out int pfActive);
abstract member IsCmdUIContextActive : uint32 * int -> int
Public Function IsCmdUIContextActive (dwCmdUICookie As UInteger, ByRef pfActive 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).

pfActive
Int32

[out] Flag set to true if the command UI context identified by dwCmdUICookie is active and false otherwise.

Returns

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

COM Signature

From vsshell.idl:

HRESULT IVsMonitorSelection::IsCmdUIContextActive(  
   [in]  VSCOOKIE  dwCmdUICookie,  
   [out] BOOL     *pfActive  
);  

Command UI contexts are associations between a GUID and a command that affects the UI. It is monitored by the SVsShellMonitorSelection service and set by VSPackages as necessary. Typical uses of the command UI context are to activate a particular mode such as design mode or debug mode and to selectively display a toolbar or menu command. To toggle the state of a command UI context, call SetCmdUIContext.

Applies to