MimeDeleteStoredMessage Function  
 
BOOL WINAPI MimeDeleteStoredMessage(
  HMESSAGESTORE hStorage,  
  LONG nMessageId  
);

The MimeDeleteStoredMessage function removes the specified message from the message store.

Parameters

hStorage
Handle to the message store.
nMessageId
An integer value which identifies the message that is to be removed from the message store. Message numbers begin at one and increment for each message in the store.

Return Value

If the function succeeds, the return value is non-zero. If the function fails, the return value is zero. To get extended error information, call MimeGetLastError.

Remarks

The MimeDeleteStoredMessage function marks the specified message for deletion from the storage file. When the message store is closed or purged, the message is removed from the file. Once a message has been marked for deletion, it may no longer be referenced by the application. For example, you cannot access the contents of a message that has been deleted.

The message store must be opened with write access. This function will fail if you attempt to delete a message from a storage file that has been opened for read-only access. If the application needs to delete messages in the message store, it is recommended that the file be opened for exclusive access using the MIME_STORAGE_LOCK option.

Requirements

Client: Requires Windows 7, Windows Vista or Windows XP.
Server: Requires Windows Server 2008 or Windows Server 2003.
Header: Include cstools7.h.
Library: Use csmsgav7.lib.

See Also

MimeCloseMessageStore, MimeFindStoredMessage, MimeGetStoredMessage, MimeGetStoredMessageCount, MimePurgeMessageStore