IMAPIMessageSite::DeleteMessage
The IMAPIMessageSite::DeleteMessage
method deletes the current message.
Quick Info
See IMAPIMessageSite
: IUnknown
HRESULT DeleteMessage(
LPMAPIVIEWCONTEXT pViewContext, |
|
LPCRECT prcPosRect |
|
) |
|
Parameters
pViewContext
[in] Pointer
to a view context object.
prcPosRect
[in] Pointer
to a RECT structure containing the current form s window size and
position. The next form displayed also uses this window rectangle.
Return Values
S_OK
The call
succeeded and has returned the expected value or values.
MAPI_E_NO_SUPPORT
The operation
is not supported by this message site.
Remarks
A form object
calls the IMAPIMessageSite::DeleteMessage method to delete
the message the form is currently attached to.
Notes to Callers
Following the
return of DeleteMessage, form objects must check for a new message and
then dismiss themselves if none exists. To determine whether a message DeleteMessage
acted on is deleted or moved to a Deleted Items folder, a form object can call
the IMAPIMessageSite::GetSiteStatus
Notes to Implementers
If a form
viewer s implementation of DeleteMessage moves to the next message after
deleting a message, it should call the IMAPIViewContext::ActivateNext
A typical
implementation of DeleteMessage:
1. If moving the message, calls the IPersistMessage::Save method passing NULL for its
pMessage parameter and TRUE for its fSameAsLoad parameter.
2. Calls the IMAPIViewContext::ActivateNext
method passing the VCDIR_DELETE flag in its ulDir parameter.
3. If the ActivateNext call failed, it
returns. If ActivateNext returned S_FALSE, it calls the IPersistMessage::HandsOffMessage method.
4. Deletes or moves the message.
To obtain the
RECT structure used by a form s window, call the Windows GetWindowRect
function.
For more
information about implementing the interfaces related to form servers, see MAPI
Form Interfaces Used by Client Applications
See Also