Register a Source Provider
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.
- CEPROPVAL structure
- IPimSrcContactListIcon::Paint method
- IPimSrcContactSummaryCard::Display method
- PIMSRC_COLOR enumeration
- Source Provider Customization Type Flags
To run the code sample
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.
Build the solution (Ctrl+Shift+B).
Deploy the solution (F5).
To register and use the application
Create a few Contact items with pictures.
Create and a few Appointment items.
Halt the "poutlook.exe" process. You can do this using the Remote File Viewer tool.
Call "regsvrce pimexprovider.dll". This is done automatically when you deploy the project.
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.
Windows Mobile 6 Professional SDK
Windows Mobile 6 Standard SDK
Visual Studio 2005.
ActiveSync Version 4.5.
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