IExchExtCommands::DoCommand

Carries out a menu or toolbar command chosen by the user.

Quick Info

See IExchExtCommands : IUnknown.

HRESULT DoCommand(
  LPEXCHEXTCALLBACK lpeecb,   
  UINT cmdid                  
);
 

Parameters

lpeecb
[in] Pointer to an IExchExtCallback interface.
cmdid
[in] Command identifier of the command to be carried out.

Return Values

S_OK
The extension object recognized the cmdid parameter and carried out the command. Microsoft Exchange will consider the task handled.
S_FALSE
The extension object did not recognize the cmdid parameter. Microsoft Exchange will continue prompting extension objects to carry out the command and, if necessary, carry out the command itself. In some cases, an extension object might perform some action but still return S_FALSE to give other extensions the opportunity to handle the command.

Remarks

Microsoft Exchange calls the IExchExtCommands::DoCommand method when it receives a WM_COMMAND or WM_SYSCOMMAND message corresponding to a menu command, system menu command, or toolbar button so that the extension object can carry out any commands it implements or supersede the Microsoft Exchange implementation of a command. The command identifier passed to WM_COMMAND is mapped to the published set of Microsoft Exchange commands. It is this published command identifier that is passed to DoCommand in the cmdid parameter. The command identifier in WM_COMMAND maps to, but is different than, the command identifier specified in the cmdid parameter. Extension objects should therefore not rely on this mapping.

If an error occurs, DoCommand should display a message and return an error value. Microsoft Exchange will not continue trying to perform the command nor will it display a message.

The system command identifiers that extensions can override include:

SC_CLOSE
SC_MAXIMIZE
SC_MINIMIZE
SC_MOVE
SC_RESTORE
SC_SIZE
SC_TASKLIST

These commands are standard wparam values for the WM_SYSCOMMAND message.