Condividi tramite


IVsCommandWindow.ExecuteCommand(String) Method

Definition

Executes the specified command.

public:
 int ExecuteCommand(System::String ^ szCommand);
public:
 int ExecuteCommand(Platform::String ^ szCommand);
int ExecuteCommand(std::wstring const & szCommand);
public int ExecuteCommand (string szCommand);
abstract member ExecuteCommand : string -> int
Public Function ExecuteCommand (szCommand As String) As Integer

Parameters

szCommand
String

[in] String containing the command.

Returns

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

Remarks

If the command is invalid or disabled the method reports the error to the user and returns S_OK.

Note that the method returns control to the caller before the command has actually executed: ExecuteCommand simply posts a Windows message. When the shell receives the message, it executes the command.

COM Signature

From vsshell.idl:

HRESULT IVsCommandWindow::ExecuteCommand(  
   [in, ref] LPCOLESTR szCommand  
);  

Applies to