IAgentCommandsEx::InsertEx

[Microsoft Agent is deprecated as of Windows 7, and may be unavailable in subsequent versions of Windows.]

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

Inserts a Command object in 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 the Command.

bszVoice

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

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. 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. 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.

dwRefID

The ID of a Command used as a reference for the relative insertion of the new Command.

dBefore

A Boolean expression that specifies where to place the Command. If this parameter is True, the new Command is inserted before the referenced Command; if False, the new Command is placed after the referenced Command.

pdwID

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

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

See Also

IAgentCommandsEx::AddEx, IAgentCommandsEx::SetHelpContextID, IAgentCommands::Add, IAgentCommands::Remove, IAgentCommands::RemoveAll