如果监控windows mobile下的通信录的变化?

zzq_gates 2007-11-02 03:17:58
如果监控windows mobile下的(通信录)sim卡和联系人的变化?或者说我有一个号吗,如果知道是否再通信录中,大侠们帮忙了!
...全文
382 7 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
jinhaijian 2007-11-15
  • 打赏
  • 举报
回复
顶一下,顺便收藏一下对我有用的帖子。
samp_miao 2007-11-15
  • 打赏
  • 举报
回复
帮忙顶一下。
wang8712 2007-11-07
  • 打赏
  • 举报
回复
2楼说的正确;

以上代码仅限于WM5.0之后的版本,之前的话,你可以通过打开Contact DB,注册消息通知窗口即可

关于查找Contact,可以调用API:
HRESULT FindMatchingContact(
IPOutlookApp * pPOOM,
LPCWSTR pszFind,
DWORD dwFlags,
IItem ** ppContact,
CEPROPID * ppropid
);
北方大冬瓜 2007-11-02
  • 打赏
  • 举报
回复
打开联系人数据库,在消息处理窗口中处理 WM_DBNOTIFICATION。
dyw 2007-11-02
  • 打赏
  • 举报
回复
提供一个链接是否更好些? 至少版式比csdn的好些。 :)
http://msdn2.microsoft.com/en-us/library/ms862902.aspx
无聊客 2007-11-02
  • 打赏
  • 举报
回复
以上代码仅限于WM5.0之后的版本,之前的话,你可以通过打开Contact DB,注册消息通知窗口即可

关于查找Contact,可以调用API:
HRESULT FindMatchingContact(
IPOutlookApp * pPOOM,
LPCWSTR pszFind,
DWORD dwFlags,
IItem ** ppContact,
CEPROPID * ppropid
);
无聊客 2007-11-02
  • 打赏
  • 举报
回复
These messages are sent to the window handle (HWND) passed to the IPOutlookApp::Logon method. They are similar to the DB_CEOID_ messages from CEDB. The messages are sent only for databases (e.g., Appointments, Contacts, and Tasks) that you have subscribed to. Notifications are sent for both changes made by Outlook Mobile (the caller) via the _LOCAL messages, and for changes made by other processes via the _REMOTE messages.

You must subscribe for notifications by setting the PIMPR_FOLDERNOTIFICATIONS property on the folder you want, with the flags that you want. Possible flag values are PIMFOLDERNOTIFICATION_LOCAL and PIMFOLDERNOTIFICATION_REMOTE. The flags are independent, and you can set the value to 0 to stop notifications. For multiple folders of the same type, the last setting to this property from any of those folders, will be used for all such folders.

The following table lists the flags for receiving notifications.

Notification Value Description
PIMFOLDERNOTIFICATION_LOCAL
0x01
Notification for changes from this process.

PIMFOLDERNOTIFICATION_REMOTE
0x02
Notification for changes from other processes.

PIMFOLDERNOTIFICATION_ALL
0x03
Notification for changes from all processes. (PIMFOLDERNOTIFICATION_REMOTE | PIMFOLDERNOTIFICATION_LOCAL)


The following table lists the notification window messages for changes in local and remote processes.

Notification Value Description
PIM_ITEM_CREATED_LOCAL
WM_APP + 0x100
PIM item created locally.

PIM_ITEM_DELETED_LOCAL
WM_APP + 0x101
PIM item deleted locally.

PIM_ITEM_CHANGED_LOCAL
WM_APP + 0x102
PIM item changed locally.

PIM_ITEM_CREATED_REMOTE
WM_APP + 0x105
PIM item created remotely.

PIM_ITEM_DELETED_REMOTE
WM_APP + 0x106
PIM item deleted remotely.

PIM_ITEM_CHANGED_REMOTE
WM_APP + 0x107
PIM item changed remotely.

Note:
wParam = Item OID, lParam = The folder containing the item.

Code Example 1
The following code example demonstrates how to subscribe to the different types of notifications.

Note:
To make the following code example easier to read, security checking and error handling are not included. This code example should not be used in a release configuration unless it has been modified to include them.
Copy Code
void NotificationsExample()
{
HRESULT hr = E_FAIL;
IPOutlookApp2 *pPoom = NULL;

// Initialize COM for using the Pocket Outlook Object Model (POOM).
CoInitializeEx(NULL, 0);

// Get a reference to the POOM (Outlook Mobile) application object.
hr = CoCreateInstance(CLSID_Application, NULL, CLSCTX_INPROC_SERVER, IID_IPOutlookApp2, (LPVOID*)&pPoom);

// Logon to a POOM session. Pass-in a valid handle to the POOM session parent window so the notifications can be processed from it's wndproc. Outlook Mobile uses this handle for each PIM item's Display call, as well as for the infrared transfer dialog.

hr = pPoom->Logon((long)hWnd);

// CASE 1: Subscribe to local and remote appointment notifications.
hr = SubscribeToNotifications(pPoom, olFolderCalendar, PIMFOLDERNOTIFICATION_ALL);

// CASE 2: Subscribe to remote contact notifications. I.e., changes made in another process.
hr = SubscribeToNotifications(pPoom, olFolderContacts, PIMFOLDERNOTIFICATION_REMOTE);

// CASE 3: Substribe for local task notifications. I.e., changes made in this process.
hr = SubscribeToNotifications(pPoom, olFolderTasks, PIMFOLDERNOTIFICATION_LOCAL);

// Insert your code for creating a dialog window, here.

return;
}


Code Example 2
The following code example demonstrates how to subscribe to notifications based on folder type.

Note:
To make the following code example easier to read, security checking and error handling are not included. This code example should not be used in a release configuration unless it has been modified to include them.
Copy Code
HRESULT SubscribeToNotifications(IPOutlookApp2 *pPoom, OlDefaultFolders olFolder, uint uiNotificationsType)
{
HRESULT hr = 0;
IFolder *pFolder = NULL;
IItem *pItem = NULL;
CEPROPVAL propval = {0};

// Get the folder for the item type.
hr = pPoom->GetDefaultFolder(olFolder, &pFolder);

// Get the IItem interface for the IFolder.
hr = pFolder->QueryInterface(IID_IItem, (LPVOID*)&pItem);

// Set the folder's properties.
propval.propid = PIMPR_FOLDERNOTIFICATIONS;
propval.val.ulVal = uiNotificationsType;
hr = pItem->SetProps(0, 1, &propval);

// Release resources.
pItem->Release();
pFolder->Release();

return hr;
}

7,656

社区成员

发帖
与我相关
我的任务
社区描述
Windows Phone是微软发布的一款手机操作系统,它将微软旗下的Xbox LIVE游戏、Zune音乐与独特的视频体验整合至手机中。
社区管理员
  • Windows客户端开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧