共用方式為


IAgentCommands::Add

[Microsoft代理程式從 Windows 7 開始已被取代,而且可能無法在後續版本的 Windows 中使用。]

HRESULT Add(
   BSTR bszCaption,  // Caption setting for Command
   BSTR bszVoice,    // Voice setting for Command
   long bEnabled,    // Enabled setting for Command
   long bVisible,    // Visible setting for Command
   long * pdwID      // address for variable for ID
);

命令 新增至 Commands 集合。

  • 傳回S_OK,表示作業成功。

bszCaption

BSTR,指定 Commands 集合中 Command 所顯示的 Caption 文字值。

bszVoice

BSTR,指定 Commands 集合中 CommandVoice 文字設定的值。

bEnabled

布爾表達式,指定 Commands 集合中 CommandEnabled 設定。 如果 參數 True,則會啟用 Command,而且可以選取;如果 False,則會停用 命令

bVisible

布爾表達式,指定 Commands 集合中 CommandVisible 設定。 如果參數 True,則 命令 會顯示在字元的彈出視窗中(如果也會設定 Caption 属性)。

pdwID

接收已新增命令 命令標識碼之變數的位址

另請參閱

IAgentCommand::SetCaptionIAgentCommand::SetEnabledIAgentCommand::SetVisibleIAgentCommand ::SetVoiceIAgentCommands::InsertIAgentCommands::RemoveIAgentCommands::RemoveAll