ImapIdleProc Method  
 
VOID CALLBACK ImapIdleProc(
  HCLIENT hClient,  
  UINT nUpdateId,  
  UINT nMessageId,  
  DWORD_PTR dwParam  
);

The ImapIdleProc function is an application-defined callback function that is invoked whenever the server sends a status update to the client. For more information about status monitoring, refer to the Idle method.

Parameters

hClient
Handle to the client session.
nUpdateId
An unsigned integer which specifies the type of update notification that has been sent by the server. It may be one of the following values:
Value Description
IMAP_UPDATE_UNKNOWN The server has sent an unrecognized notification message. The value of the nMessageId argument is undefined for this type of notification. This does not necessarily reflect an error condition, as some servers may send additional notification messages beyond the standard EXISTS, EXPUNGE and RECENT messages. Most applications should ignore this type of notification.
IMAP_UPDATE_MESSAGE The server has sent notification message to the client indicating that a new message has arrived. The nMessageId argument will contain the message number for the new message. Typically this update notification occurs shortly after the new message has been stored in the current mailbox.
IMAP_UPDATE_EXPUNGE The server has sent a notification message to the client indicating that a message has been removed from the current mailbox. The nMessageId argument will contain the message number for the message that has been removed. It is recommended that the application re-examine the mailbox when this notification is received. Typically this notification is only sent periodically by the server, and may not be sent immediately after a message has been expunged from the mailbox.
IMAP_UPDATE_MAILBOX The server has sent notification message to the client indicating that the state of the mailbox has changed. The nMessageId argument is not used with this notification. This message is sent periodically by the server and may not be sent immediately after a new message arrives or a message is flagged as unread. It is recommended that the application re-examine the mailbox when this notification is received.
nMessageId
An unsigned integer which specifies the message number associated with the status change. Note that this argument is not used with the IMAP_UPDATE_MAILBOX notification and will contain a value of zero.
dwParam
A user-defined integer value which was specified when the Idle method was called.

Return Value

None.

Remarks

An application must enable this callback function by passing its address to the Idle method. The ImapIdleProc function is a placeholder for the application-defined function name.

Requirements

Minimum Desktop Platform: Windows 7 Service Pack 1
Minimum Server Platform: Windows Server 2008 R2 Service Pack 1
Header File: cstools12.h
Import Library: csmapv12.lib

See Also