本文整理汇总了C++中CJabberProto::setWord方法的典型用法代码示例。如果您正苦于以下问题:C++ CJabberProto::setWord方法的具体用法?C++ CJabberProto::setWord怎么用?C++ CJabberProto::setWord使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CJabberProto
的用法示例。
在下文中一共展示了CJabberProto::setWord方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: email
//.........这里部分代码省略.........
}
}
break;
case NM_CLICK:
NMLISTVIEW *nm = (NMLISTVIEW *)lParam;
if (nm->iSubItem < 2)
break;
const char* szIdTemplate = (nm->hdr.idFrom == IDC_PHONES) ? "Phone%d" : "e-mail%d";
const char* szFlagTemplate = (nm->hdr.idFrom == IDC_PHONES) ? "PhoneFlag%d" : "e-mailFlag%d";
LVHITTESTINFO hti;
hti.pt.x = (short)LOWORD(GetMessagePos());
hti.pt.y = (short)HIWORD(GetMessagePos());
ScreenToClient(nm->hdr.hwndFrom, &hti.pt);
if (ListView_SubItemHitTest(nm->hdr.hwndFrom, &hti) == -1)
break;
LVITEM lvi;
lvi.mask = LVIF_PARAM;
lvi.iItem = hti.iItem;
lvi.iSubItem = 0;
ListView_GetItem(nm->hdr.hwndFrom, &lvi);
if (lvi.lParam == -1) {
if (hti.iSubItem == 3) {
//add
EditDlgParam param = { -1, ppro };
int res;
if (nm->hdr.idFrom == IDC_PHONES)
res = DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_VCARD_ADDPHONE), hwndDlg, EditPhoneDlgProc, (LPARAM)¶m);
else
res = DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_VCARD_ADDEMAIL), hwndDlg, EditEmailDlgProc, (LPARAM)¶m);
if (res != IDOK)
break;
SendMessage(hwndDlg, M_REMAKELISTS, 0, 0);
ppro->m_vCardUpdates |= (1UL << iPageId);
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
}
else {
if (hti.iSubItem == 3) {
//delete
char idstr[33];
int i;
for (i = lvi.lParam;; i++) {
mir_snprintf(idstr, szIdTemplate, i + 1);
ptrA fieldVal(ppro->getStringA(idstr));
if (fieldVal == NULL) break;
mir_snprintf(idstr, szIdTemplate, i);
ppro->setString(idstr, fieldVal);
mir_snprintf(idstr, szFlagTemplate, i + 1);
WORD nFlag = ppro->getWord(idstr, 0);
mir_snprintf(idstr, szFlagTemplate, i);
ppro->setWord(idstr, nFlag);
}
mir_snprintf(idstr, szIdTemplate, i);
ppro->delSetting(idstr);
mir_snprintf(idstr, szFlagTemplate, i);
ppro->delSetting(idstr);
SendMessage(hwndDlg, M_REMAKELISTS, 0, 0);
ppro->m_vCardUpdates |= (1UL << iPageId);
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
else if (hti.iSubItem == 2) {
EditDlgParam param = { (int)lvi.lParam, ppro };
int res;
if (nm->hdr.idFrom == IDC_PHONES)
res = DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_VCARD_ADDPHONE), hwndDlg, EditPhoneDlgProc, (LPARAM)¶m);
else
res = DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_VCARD_ADDEMAIL), hwndDlg, EditEmailDlgProc, (LPARAM)¶m);
if (res != IDOK)
break;
SendMessage(hwndDlg, M_REMAKELISTS, 0, 0);
ppro->m_vCardUpdates |= (1UL << iPageId);
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
}
}
}
break;
case WM_SETCURSOR:
if (LOWORD(lParam) != HTCLIENT) break;
if (GetForegroundWindow() == GetParent(hwndDlg)) {
POINT pt;
GetCursorPos(&pt);
ScreenToClient(hwndDlg, &pt);
SetFocus(ChildWindowFromPoint(hwndDlg, pt)); //ugly hack because listviews ignore their first click
}
break;
case WM_DESTROY:
ppro->WindowUnsubscribe(hwndDlg);
break;
}
return FALSE;
}