[in] A handle to the parent window of any dialog boxes or windows that this method displays.
[in] The byte count in the entry identifier pointed to by the lpTargetTransport parameter. The cbTargetTransport parameter is set only on calls to the MAPI spooler's status object. For calls to a transport provider, the cbTargetTransport parameter is set to 0.
[in] A pointer to the entry identifier of the transport provider that is to flush its message queues. The lpTargetTransport parameter is set only on calls to the MAPI spooler's status object. For calls to a transport provider, the lpTargetTransport parameter is set to NULL.
[in] A bitmask of flags that controls the flush operation. The following flags can be set:
The flush operation can occur asynchronously. This flag applies only to the MAPI spooler's status object.
The incoming message queues should be flushed.
The flush operation should occur regardless, in spite of the chance of a decrease in performance. This flag must be set when an asynchronous transport provider is targeted.
The status object should not display a progress indicator.
The IMAPIStatus::FlushQueues method requests that the MAPI spooler or a transport provider immediately send all messages in the outgoing queue or receive all messages from the incoming queue. FlushQueues is implemented only by the MAPI spooler status object and by status objects that transport providers supply.
MAPI_E_BUSY should be returned for asynchronous requests so that clients can continue work.
By default, FlushQueues is a synchronous operation; control does not return to the caller until the flush has completed. Only the flush operation performed by the MAPI spooler can be asynchronous; clients request this behavior by setting the FLUSH_ASYNC_OK flag.
A remote transport provider's implementation of FlushQueues sets bits in the PR_STATUS_CODE (PidTagStatusCode) property in the logon object's status row to control how queues are flushed. If a remote viewer passes in the FLUSH_UPLOAD flag, the FlushQueues method should set the STATUS_INBOUND_ENABLED and STATUS_INBOUND_ACTIVE bits. If a remote viewer passes in the FLUSH_DOWNLOAD flag, the FlushQueues method should set the STATUS_OUTBOUND_ENABLED and STATUS_OUTBOUND_ACTIVE bits. FlushQueues should then return S_OK. The MAPI spooler will then initiate the appropriate actions to upload and download messages.
A call to the MAPI spooler status object is a directive to transfer all messages either to or from the appropriate transport provider. When you call an individual transport provider's status object, only the messages for that provider are affected.