Last modified: July 23, 2011

Applies to: Outlook

Requests that the transport provider immediately deliver all pending inbound or outbound messages.

HRESULT FlushQueues(
  ULONG_PTR ulUIParam,
  ULONG cbTargetTransport,
  LPENTRYID lpTargetTransport,
  ULONG ulFlags


[in] A handle to the parent window of any dialog boxes or windows that this method displays.


[in] Reserved; must be zero.


[in] Reserved; must be NULL.


[in] A bitmask of flags that controls how message queue flushing is accomplished. The following flags can be set:


The inbound message queue or queues should be flushed.


The transport provider should process this request, if possible, even if doing so is time consuming.


The transport provider should not display a user interface.


The outbound message queue or queues should be flushed.


The call succeeded and returned the expected value or values.

The MAPI spooler calls the IXPLogon::FlushQueues method to advise the transport provider that the MAPI spooler is about to begin processing messages. The transport provider should call the IMAPISupport::ModifyStatusRow method to set an appropriate bit for its state in the PR_STATUS_CODE (PidTagStatusCode) property of its status row. After updating its status row, the transport provider should return S_OK for the FlushQueues call. The MAPI spooler then starts sending messages, with the operation being synchronous to the MAPI spooler.

To support its implementation of the IMAPIStatus::FlushQueues method, the MAPI spooler calls IXPLogon::FlushQueues for all logon objects for active transport providers that are running in a profile session. When a transport provider's FlushQueues method is called as a result of a client application call to IMAPIStatus::FlushQueues, the message processing occurs asynchronously to the client.