Platform SDK: Exchange Server

Extension Contexts

Before implementing interfaces within an extension object, it is important to know the extension’s associated context or contexts. A context corresponds to a user interface, particular window, or a related set of windows, within the Microsoft Exchange client. For example, the search viewer is one context and the main viewer is another. Two exceptions, the first two described in the following chart, are the contexts that last the duration of a task or the duration of a session. Most extension objects are designed to operate only within a particular context or set of contexts, but some can operate in all contexts.

The following contexts are defined within the Microsoft Exchange client:

EECONTEXT_TASK
The duration of the Microsoft Exchange task, from program start to program exit. This may span several logons. This context does not correspond to a Microsoft Exchange window. In this context, an extension can abort Exchange startup by returning an error.
EECONTEXT_SESSION
The duration of a Microsoft Exchange session from logon to logoff. Multiple logons can occur during a single execution of Microsoft Exchange, but they might not overlap. This context does not correspond to a Microsoft Exchange window.
EECONTEXT_VIEWER
The main Viewer window that displays the folder hierarchy in the left pane and folder contents in the right pane.
EECONTEXT_REMOTEVIEWER
The Remote Mail window that is displayed when the user chooses the Remote Mail command.
EECONTEXT_SEARCHVIEWER
The Find window that is displayed when the user chooses the Find command.
EECONTEXT_ADDRBOOK
The Address Book window that is displayed when the user chooses the Address Book command. This context only applies to a modeless address book.
EECONTEXT_SENDNOTEMESSAGE
The standard Compose, New Message window in which messages of class IPM.Note are composed.
EECONTEXT_READNOTEMESSAGE
The standard read note window in which messages of class IPM.Note are read after they are received.
EECONTEXT_READREPORTMESSAGE
The read report message window in which report messages (Read, Delivery, Non-Read, Non-Delivery) are read after they are received.
EECONTEXT_SENDRESENDMESSAGE
The send resend message window that is displayed when the user chooses the Send Again command on the non-delivery report.
EECONTEXT_SENDPOSTMESSAGE
The standard posting window in which existing posting messages are composed.
EECONTEXT_READPOSTMESSAGE
The standard posting window in which existing posting messages are read.
EECONTEXT_PROPERTYSHEETS
A property sheet window.
EECONTEXT_ADVANCEDCRITERIA
The dialog box in which the user specifies advanced search criteria.

Extensions register their “interest” in one or more of these contexts by placing entries in the EXCHNG.INI file on 16-bit versions of Microsoft Windows or in the registry on 32-bit Windows NT or Windows 95. When an extension registers for a context, it means that events associated with this context will cause the extension to be notified of the event. For example, if an extension registers for the EECONTEXT_VIEWER context, and the user selects an object, such as a folder or message, in the Viewer window, the extension will be called by Microsoft Exchange to notify it of the event.

If an extension does not register in specific contexts, it will be loaded and prompted to install itself in all contexts. Since loading extensions may reduce the performance of the Microsoft Exchange client, it is strongly recommended that all extensions specifically include context information as part of their registration.

Note  If the standard Compose Message or Compose New Post has been replaced by a custom form, extensions that are normally called from the standard Compose Message and Compose New Post will not be called unless the replacement IPM.Note form supports extensibility. This means that the form must do all the same work that the Microsoft Exchange client does when activating a form. Extensions are never called for message types other than the standard note, unless the form author has specifically put in calls to extensions.