OpenAddressBook

The OpenAddressBook function opens the Contacts database if it exists.

Syntax

BOOL OpenAddressBook(HWND hwnd, HHPRTAG hhProp);

At a Glance

Header file: Addrstor.h
Platforms: H/PC
Versions: 1.0 and later

Parameters

hwnd
Handle to the window to which notification messages (DB_PEGOID_*) are posted if another thread modifies the Contacts database while your application has it open. This parameter can be NULL if your application does not need to receive notifications.
hhProp
Property tag that identifies the property on which the address cards are to be sorted. The property tag must be one of the tags specified in the call to the CreateAddressBook or SetColumnProperties function, or one of the default tags if the user specified NULL instead of an array of tags. If the sort order is not important, this parameter can be zero.

Return Values

Returns TRUE if the Contacts database exists and was opened, or FALSE if an error occurs. To get extended error information, call the GetLastError function. The extended error value is ERROR_FILE_NOT_FOUND if the database does not exist.

Remarks

The OpenAddressBook function fails if hhProp is not a valid property tag.

When it has finished with the Contacts database, an application must close it by using the CloseAddressBook function.

For more information, see Contacts Database.

See Also

CloseAddressBook, CreateAddressBook