Saturday, August 02, 2008

Showing a list of contacts programmatically on Windows Mobile

A question that gets asked quite frequently in the communities, is "how do I show a list of contacts contained within the PIM on Windows Mobile devices programmatically".

Well the answer is very simple if running CF 2.0 or later simply write something like the following:
System.Diagnostics.Process.Start("poutlook.exe", "contacts");
So we start process poutlook and pass contacts as a parameter. If you're using pre-CF 2.0 then you'll have to P/invoke ShellExecuteEx Win32 API.

Of course the code above will use the Outlook Mobile application to display contacts on Windows Mobile. To write you're own UI you'd have to use the POOM API to populate you're own UI.

No comments: