Register a Source Provider

Windows Mobile SupportedWindows Embedded CE Not Supported


This code sample is named PimExProvider. It demonstrates how to register a source provider for the Contact and Calendar applications.

The source provider implements 3 features:

  • Paints the contact's picture in the Contact application list-view.
  • Creates a custom Summary tab to display the Contact item.
  • Changes the background color of an Appointment item in the Agenda, Day, and Week views.

Feature Area

Relevant APIs


To run the code sample

  1. Navigate to the solution file (*.sln), and double-click it. By default, the solution file is copied to the following folder:

    C:\Program Files\Windows Mobile 6 SDK\Samples\PocketPC\CPP\win32\PimExProvider

    Microsoft Visual Studio 2005 launches and loads the solution.

  2. Build the solution (Ctrl+Shift+B).

  3. Deploy the solution (F5).

To register and use the application

  1. Create a few Contact items with pictures.

  2. Create and a few Appointment items.

  3. Halt the "poutlook.exe" process. You can do this using the Remote File Viewer tool.

  4. Call "regsvrce pimexprovider.dll". This is done automatically when you deploy the project.

  5. Re-launch the Contacts and/or Calendar application to see the customizations.


Source Providers and their associated Source ID's are part of a mechanism that supports per-provider customization of the PIM experience on mobile devices.

A Source Provider is a custom function that customizes the PIM user experience. Typically, a Source Provider has a corresponding associate function that is responsible for synchronizing PIM data with the mobile device. Data synchronized with the mobile device by this associate function is marked with a Source identification tag (Source ID). When Outlook Mobile displays a PIM item, it checks to see if the item has a Source ID. If it finds one, it invokes the Source Provider, which customizes the user interface for the PIM item.

In addition, when the user enters new PIM data on the mobile device, they will be able to select the Source Provider to use.

PIM items with a Source ID value of zero just use the default user interface.

This code sample updates the Source ID for all existing Contact and Appointment items in the store.

These updates are reverted when the DLL is un-registered.

Development Environments

Windows Mobile 6 Professional SDK

Windows Mobile 6 Standard SDK

Visual Studio 2005.

ActiveSync Version 4.5.

See Also


Code Samples for Windows Mobile

Other Resources

Customizing the PIM User Experience by Using Source Providers
Source Provider Customization Type Flags
Source Provider PIM Type Ownership Flags
Customizing an Appointment Item's Background Color