The IMAPIMessageSite::DeleteMessage method deletes the current message.
See IMAPIMessageSite : IUnknown.
HRESULT DeleteMessage(
LPMAPIVIEWCONTEXT pViewContext,
LPCRECT prcPosRect
);
A form object calls the IMAPIMessageSite::DeleteMessage method to delete the message the form is currently displaying.
Following the return of DeleteMessage, form objects must check for a new message and then dismiss themselves if none exists. To determine whether the message DeleteMessage acted on is deleted or moved to a Deleted Items folder, a form object can call the IMAPIMessageSite::GetSiteStatus method and check if the DELETE_IS_MOVE flag was returned.
If a form viewer's implementation of DeleteMessage moves to the next message after deleting a message, it should call the IMAPIViewContext::ActivateNext method passing the VCDIR_DELETE flag prior to performing the actual deletion. If a form viewer's implementation of DeleteMessage moves the deleted message, for example to a Deleted Items folder, it must save changes to the message if the message has been modified.
A typical implementation of DeleteMessage:
To obtain the RECT structure used by a form's window, call the Windows GetWindowRect function.
For a list of interfaces related to form servers, see MAPI Form Interfaces.
IMAPIMessageSite::GetSiteStatus, IMAPIViewContext::ActivateNext, IPersistMessage::HandsOffMessage, IPersistMessage::Save