共用方式為


IDTCommandTarget Interface

Definition

Allows you to create named commands. You must implement this interface to handle new named commands.

public interface class IDTCommandTarget
public interface class IDTCommandTarget
__interface IDTCommandTarget
[System.Runtime.InteropServices.Guid("7EF39A3E-590D-4879-88D4-C9BE5BCFD92E")]
[System.Runtime.InteropServices.TypeLibType(4160)]
public interface IDTCommandTarget
[System.Runtime.InteropServices.Guid("7EF39A3E-590D-4879-88D4-C9BE5BCFD92E")]
public interface IDTCommandTarget
[<System.Runtime.InteropServices.Guid("7EF39A3E-590D-4879-88D4-C9BE5BCFD92E")>]
[<System.Runtime.InteropServices.TypeLibType(4160)>]
type IDTCommandTarget = interface
[<System.Runtime.InteropServices.Guid("7EF39A3E-590D-4879-88D4-C9BE5BCFD92E")>]
type IDTCommandTarget = interface
Public Interface IDTCommandTarget
Attributes

Remarks

The IDTCommandTarget interface allows you to implement named commands in the environment. It also allows you to define the status of a command or execute it.

If you enter a command that was added with the AddNamedCommand method to the Command window, the Command window first uses the IDTCommandTarget interface's QueryStatus method to determine if the command is enabled. The same also applies if you call the ExecuteCommand method.

If you implement this interface in addition to IDTExtensibility2, then command execution is routed directly to this interface for named commands in your extension.

This interface is analogous to the IDTCommandTarget interface defined in the Win32 SDK, except that the parameters of the method are OLE automation-compliant.

Methods

Exec(String, vsCommandExecOption, Object, Object, Boolean)

Executes the specified named command.

QueryStatus(String, vsCommandStatusTextWanted, vsCommandStatus, Object)

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

Applies to