IDTCommandTarget.QueryStatus Method

Definition

Returns the current status (enabled, disabled, hidden, and so forth) of the specified named command.

C++/WinRT
void QueryStatus(std::wstring const & CmdName, EnvDTE::vsCommandStatusTextWanted NeededText, [Runtime::InteropServices::Out] EnvDTE::vsCommandStatus & StatusOption, [Runtime::InteropServices::Out] winrt::Windows::Foundation::IInspectable const & & CommandText);

Parameters

CmdName
String

The name of the command to check.

NeededText
vsCommandStatusTextWanted

A vsCommandStatusTextWanted constant specifying if information is returned from the check, and if so, what type of information is returned.

StatusOption
vsCommandStatus

A vsCommandStatus specifying the current status of the command.

CommandText
Object

The text to return if vsCommandStatusTextWantedStatus is specified.

Attributes

Remarks

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.

Applies to

Product Versions
Visual Studio SDK 2015, 2017, 2019, 2022