Registers a command UI context
GUID and returns cookie value.
Namespace: Microsoft.VisualStudio.Shell.Interop
Assembly: Microsoft.VisualStudio.Shell.Interop (in microsoft.visualstudio.shell.interop.dll)
Visual Basic (Declaration)
Function GetCmdUIContextCookie ( _
<InAttribute> ByRef rguidCmdUI As Guid, _
<OutAttribute> ByRef pdwCmdUICookie As UInteger _
) As Integer
Dim instance As IVsMonitorSelection
Dim rguidCmdUI As Guid
Dim pdwCmdUICookie As UInteger
Dim returnValue As Integer
returnValue = instance.GetCmdUIContextCookie(rguidCmdUI, pdwCmdUICookie)
int GetCmdUIContextCookie (
[InAttribute] ref Guid rguidCmdUI,
out uint pdwCmdUICookie
)
int GetCmdUIContextCookie (
[InAttribute] Guid% rguidCmdUI,
[OutAttribute] unsigned int% pdwCmdUICookie
)
int GetCmdUIContextCookie (
/** @attribute InAttribute() */ /** @ref */ Guid rguidCmdUI,
/** @attribute OutAttribute() */ /** @ref */ UInt32 pdwCmdUICookie
)
JScript does not support passing value-type arguments by reference.
Parameters
- rguidCmdUI
[in] GUID representing a specific command UI context. Command UI context GUID values are defined by the environment and by VSPackages to meet specific needs. See the Remarks section below for a list of command UI GUIDs defined by the environment.
- pdwCmdUICookie
[out] Pointer to a DWORD representing the GUID value in rguidCmdUI.
Return Value
If the method succeeds, it returns S_OK. If it fails, it returns an error code.
COM Signature
From vsshell.idl:
HRESULT IVsMonitorSelection::GetCmdUIContextCookie(
[in] REFGUID rguidCmdUI,
[out] VSCOOKIE *pdwCmdUICookie
);
This method registers the specified GUID and returns a cookie to represent that GUID. The active state of the GUID can be changed by calls to the SetCmdUIContext method and can be read by calls to the IsCmdUIContextActive method.
Note Once a GUID is registered through this method, the GUID remains registered until the IDE exits.
Command UI contexts involve associating a GUID to an action or a change in the UI. They are used in a variety of situations. VSPackages often define command UI contexts to associate a GUID to the activation of a toolbar or to the availability of a command. The environment defines the following command UI contexts. VSPackages are free to define additional context GUIDs but a VSPackage must change only the context GUIDs it registers.