Platform SDK: Exchange Server |
Enables an extension object to update its menu items when the user begins to use the menu.
See IExchExtCommands : IUnknown.
VOID InitMenu( LPEXCHEXTCALLBACK lpeecb );
Microsoft Exchange calls the IExchExtCommands::InitMenu method when it receives a WM_INITMENU message, allowing the extension object to enable, disable, or update its menu commands before the user sees them. This method is called frequently and should be written in a very efficient manner.
If your command extension needs to be enabled when specific message classes or folders are selected, use the IExchExtCallback::GetSelectionCount method to determine whether there currently is a selection, and use the GetSelectionItem method to traverse the selection. You would traverse the selection to see whether the selected objects are of interest to your command extension.
Microsoft Exchange intercepts the EnableMenuItem message and applies the same enabled or disabled state to the associated toolbar button. These menu items and toolbar buttons do not have to be set independently.
IExchExtCallback::GetSelectionCount, IExchExtCallback::GetSelectionItem