About the Offline State API
|About the Offline State API|
The Offline State API supports callbacks indicating changes in a user's connection state in Outlook—for example, from being online in Outlook to being offline. The API uses a global offline object in Outlook to track such changes for a given user account profile. Notification is the only supported form of callback. As clients of this API, mail providers who want to be notified of such connection state changes do the following:
- Implement IMAPIOfflineNotify.
- Open an existing offline object for a specific profile using HrOpenOfflineObj.
- Determine if the object has the capability of providing online or offline notifications using IMAPIOffline::GetCapabilities.
- Register the object for online or offline notifications using IMAPIOfflineMgr::Advise. Mail providers can now receive notifications that Outlook sends using IMAPIOfflineNotify.
- On shutdown, remove registration for online and offline notifications using IMAPIOfflineMgr::Unadvise.
|In general, Outlook can notify a client of online/offline changes as well as other changes, but the Offline State API supports only notifications for online/offline changes. The client should ignore all other notifications. For more information, see IMAPIOfflineNotify::Notify and MAPIOFFLINE_NOTIFY.|
For an example of a client that uses the Offline State API, see About the Sample Offline State Add-in. The Sample Offline State Add-in is a COM add-in that uses the Offline State API to monitor and change the connection state.
This API provides the following: