IAPCSpeech::AddVMenuCommand

This method adds a command to the voice menu.

Syntax

HRESULT IAPCSpeech::AddVMenuCommand( PIVCMDMENUW pMenu, LPTSTR szCmdString, UINT dwCmdID, DWORD dwFlags, DWORD dwVoiceCommand );

Parameters

pMenu
Pointer to the menu to which a command is to be added.
szCmdString
Null-terminated string that contains the command that is to be added to pMenu. The command string added to a voice menu includes three parts: command, long voice Help and short voice Help. The three parts are separated by a tab. The following table shows possible combinations.
Command
Description
cmd\tlong Help\tshort Help Has both long and short voice Help.
cmd There is no long voice Help, and short voice Help is the same as command.
cmd\t\tshort Help There is no long voice Help, and short voice Help is different from command.
cmd\tlong Help\t Has long voice Help but no short voice Help.
cmd\tlong Help Has long voice Help, and short voice Help is the same as command.

dwCmdID
Specifies the command identifier that is to be added to the voice menu.
dwFlags
Specifies a bitmask for flags. It is one of the following values:
APCSPCH_VM_USEEXISTING
If this flag is set and the command identifier already exists in the voice menu, the command is not added.
APCSPCH_VM_NOFEEDBACK
Use this flag if the application does not want the system to provide the regular feedback to this word
dwVoiceCommand
Application developer can associate a DWORD with the voice command. When the command is recognized, this DWORD is notified in the wParam of WM_SPCH_RECOG. The lParam is the command identifier.

Return Values

An appropriate HRESULT value is returned.

Remarks

To avoid duplicating string identifiers if your application uses speech enabled controls, use the ranges shown in the following table to assign string identifiers in resource file.

String identifier
Range
Application 0 to 0x7FFF
Speech enabled controls 0x8000 to 0xFFFF

The string that is passed can be separated by a tab to include context-sensitive long voice Help and short voice Help strings. For more information, see VoiceHelpStart.