Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.


This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Obtains the status associated with a message in a particular folder (for example, whether that message is marked for deletion).

HRESULT GetMessageStatus(
  ULONG cbEntryID,
  ULONG ulFlags,
  ULONG FAR * lpulMessageStatus


[in] The byte count in the entry identifier pointed to by the lpEntryID parameter.


[in] A pointer to the entry identifier for the message whose status is obtained.


[in] Reserved; must be zero.


[out] A pointer to a pointer to a bitmask of flags that indicate the message's status. Bits 0 through 15 are reserved and must be zero; bits 16 through 31 are available for implementation-specific use. The following flags can be set:


The message has been marked for deletion.


The message is not to be displayed.


The message is to be displayed highlighted.


The message has been marked for deletion at the remote message store without downloading to the local client.


The message has been marked for downloading from the remote message store to the local client.


The message has been tagged for a client-defined purpose.


The message status was successfully retrieved.

The IMAPIFolder::GetMessageStatus method returns the status of a message. Message status is stored in the message's PR_MSG_STATUS (PidTagMessageStatus) property.

How the message status bits are set, cleared, and used depends completely on your implementation, except that bits 0 through 15 are reserved and must be zero. If you store messages in the IPM subtree, MAPI reserves bits 16 through 31 for use by IPM clients. If you store messages in other subtrees, you can use bits 16 through 31 for your own purposes.

For MFCMAPI sample code, see the following table.






MFCMAPI uses the IMAPIFolder::GetMessageStatus method to get the status of the next message to be displayed.


OpenMessageNonModal and OpenMessageModal

MFCMAPI uses the IMAPIFolder::GetMessageStatus method to get the status of the message to be displayed to pass to the form viewer, which is either CMyMAPIFormViewer or IMAPISession::ShowForm.

© 2015 Microsoft