IAgentCommandsEx::AddEx

[Microsoft Agent is deprecated as of Windows 7, and may be unavailable in subsequent versions of 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
);

Adds a Command to a Commands collection.

  • Returns S_OK to indicate the operation was successful.

bszCaption

A BSTR that specifies the value of the Caption text displayed for a Command in a Commands collection.

bszVoice

A BSTR that specifies the value of the Voice text setting for a Command in a Commands collection.

bszVoiceCaption

A BSTR that specifies the value of the VoiceCaption text displayed for a Command in a Commands collection.

bEnabled

A Boolean expression that specifies the Enabled setting for a Command in a Commands collection. If the parameter is True, the Command is enabled and can be selected; if False, the Command is disabled.

bVisible

A Boolean expression that specifies the Visible setting for a Command in a Commands collection. If the parameter is True, the Command will be visible in the character's pop-up menu (if the Caption property is also set).

ulHelpID

The context number of the help topic associated with the Command object; used to provide context-sensitive Help for the command.

pdwID

Address of a variable that receives the ID for the added Command.

IAgentCommandsEx::AddEx extends IAgentCommands::Add by including the HelpContextID property. You can also set the property using IAgentCommandsEx::SetHelpContextID

See Also

IAgentCommands::Add, IAgentCommandsEx::SetHelpContextID, IAgentCommand::SetCaption, IAgentCommand::SetEnabled, IAgentCommand::SetVisible, IAgentCommand::SetVoice, IAgentCommands::Insert, IAgentCommandsEx::InsertEx, IAgentCommands::Remove, IAgentCommands::RemoveAll