Platform SDK: MAPI

Displaying Form Icons

When displaying a list of messages in a folder, it is helpful to your users if you distinguish messages with custom message classes from the standard IPM.Note messages. Custom message classes correspond to form servers, and form servers provide icons to represent themselves. You can display these icons in the list of messages to alert users to each message's message class before the user opens the messages. Typically, the icon in the form's PR_MINI_ICON property is the one that should be displayed in the list of messages. Forms also have a PR_ICON property that can be displayed when the form is minimized in a property sheet.

To get an icon for a message class without activating the form server for that message class

  1. Call the IMAPIFormMgr::OpenFormContainer method to get a pointer to an IMAPIFormContainer interface.
  2. Call the IMAPIFormContainer::ResolveMessageClass method to get a pointer to an IMAPIFormInfo interface.
  3. Call the IMAPIFormInfo::MakeIconFromBinary method to get an icon handle.

The icon can then be displayed using standard Win32 or Win16 APIs.

Warning  Once you have the icon for a message class, make every effort to cache that icon. Not caching icons severely affects the performance of client applications. When caching icons, be careful of the relationships between message classes and their subclasses. For example, if the IPM.Note.Meeting.Cancel message class happens to resolve back to IPM.Note, do not assume that all subclasses of IPM.Note should use the icon for IPM.Note.