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
);

將 Command 新增至Commands集合。

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

bszCaption

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

bszVoice

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

bEnabled

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

bVisible

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

pdwID

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

另請參閱

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