IDTCommandTarget.QueryStatus(String, vsCommandStatusTextWanted, vsCommandStatus, Object) IDTCommandTarget.QueryStatus(String, vsCommandStatusTextWanted, vsCommandStatus, Object) IDTCommandTarget.QueryStatus(String, vsCommandStatusTextWanted, vsCommandStatus, Object) IDTCommandTarget.QueryStatus(String, vsCommandStatusTextWanted, vsCommandStatus, Object) IDTCommandTarget.QueryStatus(String, vsCommandStatusTextWanted, vsCommandStatus, Object) Method

Definition

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

public:
 void QueryStatus(System::String ^ CmdName, EnvDTE::vsCommandStatusTextWanted NeededText, [Runtime::InteropServices::Out] EnvDTE::vsCommandStatus % StatusOption, [Runtime::InteropServices::Out] System::Object ^ % CommandText);
void QueryStatus(std::wstring const & CmdName, EnvDTE::vsCommandStatusTextWanted NeededText, [Runtime::InteropServices::Out] EnvDTE::vsCommandStatus & StatusOption, [Runtime::InteropServices::Out] winrt::Windows::Foundation::IInspectable const & & CommandText);
[System.Runtime.InteropServices.DispId(1)]
public void QueryStatus (string CmdName, EnvDTE.vsCommandStatusTextWanted NeededText, out EnvDTE.vsCommandStatus StatusOption, out object CommandText);
abstract member QueryStatus : string * EnvDTE.vsCommandStatusTextWanted *  *  -> unit
Public Sub QueryStatus (CmdName As String, NeededText As vsCommandStatusTextWanted, ByRef StatusOption As vsCommandStatus, ByRef CommandText As Object)

Parameters

CmdName
String String String String String

The name of the command to check.

NeededText
vsCommandStatusTextWanted vsCommandStatusTextWanted vsCommandStatusTextWanted vsCommandStatusTextWanted vsCommandStatusTextWanted

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

StatusOption
vsCommandStatus vsCommandStatus vsCommandStatus vsCommandStatus vsCommandStatus

A vsCommandStatus specifying the current status of the command.

CommandText
Object Object Object Object Object

The text to return if vsCommandStatusTextWantedStatus is specified.

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