共用方式為


IAgentCommands::Insert

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

HRESULT Insert(
   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 dwRefID,     // reference Command for insertion
   long dBefore,     // insertion position flag
   long * pdwID      // address for variable for Command ID
);

Commands 集合中插入 Command 物件。

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

bszCaption

BSTR,指定 Command所顯示之 Caption 文字的值。

bszVoice

BSTR,指定 CommandVoice 文字設定的值。

bEnabled

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

bVisible

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

dwRefID

命令 的標識符,做為新命令 命令相對插入的參考。

dBefore

布爾表達式,指定要放置 Command的位置。 如果此參數 True,則會在參考 Command之前插入新的 Command ;如果 False,則會將新的 Command 放在參考 Command之後。

pdwID

接收插入 指令之識別碼的變數位址

另請參閱

IAgentCommands::AddIAgentCommands::RemoveIAgentCommands::RemoveAll