IExchExtCallback::GetSelectionItem

Returns the entry identifier and other information of the currently selected item in a Microsoft Exchange window.

Quick Info

See IExchExtCallback : IUnknown.

HRESULT GetSelectionItem(
  ULONG ieid,             
  ULONG FAR * lpcbeid,    
  LPENTRYID FAR * lppeid,   
  ULONG FAR * lpulType,   
  LPTSTR lpszMsgClass,    
  ULONG cbMsgClass,       
  ULONG FAR * lpulMsgFlags,   
  ULONG ulFlags           
);
 

Parameters

ieid
[in] Index of the entry identifier to be retrieved. Valid values for this parameter are 0 to lpceid -1 where lpceid is returned in the IExchExtCallback::GetSelectionCount method.
lpcbeid
[out] Pointer to the number of bytes returned in the lppeid parameter.
lppeid
[out] Pointer to a pointer to the entry identifier of the selection.
lpulType
[out] Pointer to the type of entry identifier returned in the lppeid parameter. This parameter can have the following values:

MAPI_STORE = 1, if lppeid refers to a message store.

MAPI_ADDRBOOK = 2, if lppeid refers to an address book.

MAPI_FOLDER = 3, if lppeid refers to a folder.

MAPI_MESSAGE = 5, if lppeid refers to a message.

lpszMsgClass
[in, out] Pointer to a buffer into which Microsoft Exchange will copy the message class of the selected message.
cbMsgClass
[out] Size of the message class.
lpulMsgFlags
[out] Pointer to the message flags returned. See the MAPI PR_MESSAGE_FLAGS property.
ulFlags
Reserved; must be zero.

Return Values

S_OK
No errors occurred.
S_FAIL
Microsoft Exchange failed to access the selected item.
E_INVALIDARG
The ulFlags parameter is not fMapiUnicode or it is called from an invalid context that does not support the selected item.

Remarks

The IExchExtCallback::GetSelectionItem method is used to return the entry identifier of the currently selected item in a Microsoft Exchange Window. For example, if a custom form is installed and the user selects this form, extension objects that implement the IExchExtUserEvents::OnSelectionChange method can use GetSelectionItem to determine the message class of the selected message. If the extension object is programmed to handle messages of this class, it might display or enable menu items specific to the message class.

If a parameter is not used in this method, pass NULL for that parameter.

See Also

IExchExtCommands::InitMenu