IDTCommandTarget::QueryStatus Method (String^, vsCommandStatusTextWanted, vsCommandStatus, Object^)
Visual Studio 2015
Returns the current status (enabled, disabled, hidden, and so forth) of the specified named command.
Assembly: EnvDTE (in EnvDTE.dll)
void QueryStatus(
String^ CmdName,
vsCommandStatusTextWanted NeededText,
vsCommandStatus% StatusOption,
Object^% CommandText
)
Parameters
- CmdName
-
Type:
System::String^
The name of the command to check.
- NeededText
-
Type:
EnvDTE::vsCommandStatusTextWanted
A vsCommandStatusTextWanted constant specifying if information is returned from the check, and if so, what type of information is returned.
- StatusOption
-
Type:
EnvDTE::vsCommandStatus
A vsCommandStatus specifying the current status of the command.
- CommandText
-
Type:
System::Object^
The text to return if vsCommandStatusTextWantedStatus is specified.
The following example uses the Command object, its AddNamedCommand and AddControl methods, and the IDTCommandTarget interface and its (Exec and QueryStatus) methods, to demonstrate how to make a command appear on the Tools menu in Visual Studio.
Show: