For example, our application implements a contacts navigator function. If user says a name and our application recognizes the result, the program needs directly display the detail property, like that user selects Contacts in home or Programs menu, chooses the name, and presses action key. The same problem appears in Task, Calendar, Inbox, etc.
From Section 'Pocket Outlook Object Model (POOM) API' of smartphone 2002, POOM API defines all Display interface methods, but not implemented, same as smartphone 2003.
So, currently, our primary problem of UI is what's the interface that directly displays the detail information about respective item.
其实你可以参考英文版的说明，使用POOM API，就可以完全控制Pocket PC上的Contacts/Tasks/Alarm等等Outlook方面的内容。
Program Your Own Contacts Application with eMbedded Visual Basic
PocketContacts is a program I created that gives you the tools and techniques you need to build a more powerful contact management application using eMbedded Visual Basic.
What You Need
Microsoft® eMbedded Visual Basic® installed on your PC.
The Pocket PC software development kit (SDK) installed on your PC.
The Microsoft eMbedded Visual Tools emulator to test your software.
All of these tools are available on the eMbedded Visual Tools CDs. If you don't already have a copy of these tools, you can order them for free or download them from Microsoft. In addition, this program is available completely built and ready to install from my personal Web site. You can take a look at the source code there, as well.
Why Undertake This?
Why go through this process at all… Good question! Basically, I'm always tempted to add functionality to commercial software.
In this case, I wanted to add specific features. My contacts are all categorized, and if I can only sort them by one field at a time, then I can't make use of the various categories.
Features and Techniques
This program provides features above and beyond the standard Contacts software, including:
User defined fields in columns
It also demonstrates the following eMbedded Visual Basic programming techniques:
Advanced POOM (Pocket Outlook Object Model) programming
The basic Contact software that comes with the Pocket PC only shows your information sorted one way, using the File As field. This field is usually composed of Last Name followed by First name or Company Name, depending on the data.
The main routine in PocketContacts is called LoadContacts. It's located in the form called ContactForm. The following code snippet shows how easily you can sort your information:
Set ContactList = polApp.GetDefaultFolder(olFolderContacts).Items
Select Case ContactSort
Call ContactList.Sort("[FirstName]", False)
Call ContactList.Sort("[LastName]", False)
Call ContactList.Sort("[CompanyName]", False)
All you need to do is specify the field name using the .Sort verb. How simple it is!
Filters are essentially a view, which can include or exclude one or more categories of information from your display (see Figure). For example, you might want a filter called OKCustomers where you include only contacts that have a category of Excellent or Good. In addition, you can specify that you want the information sorted a certain way, and that in the second column you show the contact's e-mail address.
The options available when you apply a filter.
User Defined Columns
One of my favorite ways to increase the usability of software is to provide as many options as possible. This lets you really customize the environment to your liking. For example, why should you be required to see the phone number in the second column of the list, when you could choose?
Well, a little routine called GetField in the ContactForm allows just that. Using a filter, the user selects the field they want to display in a given column, using a combo list. The number (0—28) corresponding to the field is then passed to the GetField routine as each line is displayed and the corresponding Contact field is shown. The following fields are permitted:
Function GetField(fnum As Integer) As String
Dim s As String
Select Case fnum
Case 0: s = polItem.Anniversary
Case 1: s = polItem.Birthday
Case 2: s = polItem.BusinessFaxNumber
Case 3: s = polItem.CompanyName
Case 4: s = polItem.Department
Case 5: s = polItem.Email1Address
Case 6: s = polItem.MobileTelephoneNumber
Case 7: s = polItem.OfficeLocation
Case 8: s = polItem.PagerNumber
Case 9: s = polItem.BusinessTelephoneNumber
Case 10: s = polItem.JobTitle
Case 11: s = polItem.Email2Address
Case 12: s = polItem.Spouse
Case 13: s = polItem.Email3Address
Case 14: s = polItem.Home2TelephoneNumber
Case 15: s = polItem.HomeFaxNumber
Case 16: s = polItem.CarTelephoneNumber
Case 17: s = polItem.AssistantName
Case 18: s = polItem.AssistantTelephoneNumber
Case 19: s = polItem.Children
Case 20: s = polItem.WebPage
Case 21: s = polItem.Business2TelephoneNumber
Case 22: s = polItem.RadioTelephoneNumber
Case 23: s = polItem.FileAs
Case 24: s = polItem.Title
Case 25: s = polItem.FirstName
Case 26: s = polItem.MiddleName
Case 27: s = polItem.LastName
Case 28: s = polItem.Business2TelephoneNumber
GetField = s
You could include other fields, as well, but these are the ones I chose to make available.
Another readily available technique is that of pop-up menus. These routines use the Microsoft Windows® CE 3.0 SDK and show some simple ways you can use them. These routines are encapsulated in a module called popmenu.bas.
Finally, I've seen people looking for a Microsoft ActiveX® control to show a progress bar. This is very easy to do using the eMbedded Visual Basic grid control. Just create a grid with one row and 100 columns. Then change the background color of each column (0—99), and watch your progress!
This project is a great start into the world of advanced eMbedded Visual Basic Pocket PC programming. It demonstrates many possible user interface features. In addition, it uses several advanced programming techniques that you can re-use in any other projects you're working on.
There's plenty of room for extending this program, as well. For example, you could add colors based on category, or permit any of the columns to show any field. The possibilities are endless. My goal here is to demonstrate that advanced programming on the Pocket PC using eMbedded Visual Basic is not only possible, but also easy and fun.
所以，我想直接利用微软提供的Contacts，把自己的代码和他无缝结合起来，比方说，在Contacts,用户移动up & down， highlight一个Item, 我的TTS模块可以读出这个人的Detail infomation， 当然，程序更进一步，利用语音识别技术，识别出一个人名，直接highlight这个Item， 或者现实Detail information, 或者用TTS模块给出结果，这样盲人也可以使用手机了。
Microsoft Windows CE 3.0
This method is not supported in Windows CE Platform Builder 3.0.
This method displays a Contact item. You can display a Contact item only immediately after creating it or reading it from the object store.
S_OK indicates that the Contact item was displayed successfully, and if the user made changes, that the changes were saved correctly. If an error occurs, the appropriate HRESULT value is returned.
Runs On Versions Defined in Include Link to
Windows CE OS 2.0 and later pimstore.h
IContact::Unknown, IContact Property Methods