IVsCommandWindow::ExecuteCommand Method (String^)

 

Executes the specified command.

Namespace:   Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)

int ExecuteCommand(
	String^ szCommand
)

Parameters

szCommand
Type: System::String^

[in] String containing the command.

Return Value

Type: System::Int32

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

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.

From vsshell.idl:

HRESULT IVsCommandWindow::ExecuteCommand(
   [in, ref] LPCOLESTR szCommand
);
Return to top
Show: