共用方式為


IAgentCommandsEx::AddEx

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

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

將 Command 新增至Commands集合。

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

bszCaption

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

bszVoice

BSTR,指定Commands集合中Command語音文字設定值。

bszVoiceCaption

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

bEnabled

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

bVisible

布林運算式,指定Commands集合中CommandVisible設定。 如果參數為True,則如果Caption屬性也設定) ,則命令會顯示在字元的快顯視窗中 (。

ulHelpID

Command 物件相關聯的說明主題內容編號;用來提供命令的內容相關說明。

pdwID

接收已新增 命令識別碼的變數位址。

IAgentCommandsEx::AddEx透過包含HelpCoNtextID屬性來擴充IAgentCommands::Add。 您也可以使用IAgentCommandsEx::SetHelpCoNtextID來設定 屬性

另請參閱

IAgentCommands::AddIAgentCommandsEx::SetHelpCoNtextIDIAgentCommand::SetCaptionIAgentCommand::SetEnabledIAgentCommand::SetVisibleIAgentCommand::SetVoiceIAgentCommands::InsertIAgentCommands::InsertExIAgentCommands::Remove、IAgentCommands::RemoveAll