Compartilhar via


Forcing a Notification

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.

When service providers use the IMAPISupport : IUnknown methods for notification, MAPI delivers notifications using a hidden window and its corresponding window procedure. For each process to receive a notification, MAPI posts a special message to the hidden window. This message is named with the constant szMAPINotificationMsg which is defined in MAPIDEFS.H.

You receive these notifications when the hidden window's window procedure processes the szMAPINotificationMsg message. To guarantee that notifications are delivered, it is necessary to wait for and dispatch this szMAPINotificationMsg message. Implementing the logic to achieve this can be done fairly simply, but MAPI provides an entry point into the MAPI DLL called HrDispatchNotifications to make processing even simpler. Call HrDispatchNotifications as follows to receive notifications in your client:

HRESULT hr = HrDispatchNotifications(0);