本文整理汇总了C++中CIcqProto::icq_changeUserDirectoryInfoServ方法的典型用法代码示例。如果您正苦于以下问题:C++ CIcqProto::icq_changeUserDirectoryInfoServ方法的具体用法?C++ CIcqProto::icq_changeUserDirectoryInfoServ怎么用?C++ CIcqProto::icq_changeUserDirectoryInfoServ使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CIcqProto
的用法示例。
在下文中一共展示了CIcqProto::icq_changeUserDirectoryInfoServ方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ShowDlgItem
static INT_PTR CALLBACK DlgProcIcqPrivacyOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
CIcqProto* ppro = (CIcqProto*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
ppro = (CIcqProto*)lParam;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
{
int nDcType = ppro->getByte("DCType", 0);
int nAddAuth = ppro->getByte("Auth", 1);
if (!ppro->icqOnline()) {
icq_EnableMultipleControls(hwndDlg, icqPrivacyControls, _countof(icqPrivacyControls), FALSE);
ShowDlgItem(hwndDlg, IDC_STATIC_NOTONLINE, SW_SHOW);
}
else ShowDlgItem(hwndDlg, IDC_STATIC_NOTONLINE, SW_HIDE);
CheckDlgButton(hwndDlg, IDC_DCALLOW_ANY, (nDcType == 0) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_DCALLOW_CLIST, (nDcType == 1) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_DCALLOW_AUTH, (nDcType == 2) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_ADD_ANY, (nAddAuth == 0) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_ADD_AUTH, (nAddAuth == 1) ? BST_CHECKED : BST_UNCHECKED);
LoadDBCheckState(ppro, hwndDlg, IDC_WEBAWARE, "WebAware", 0);
LoadDBCheckState(ppro, hwndDlg, IDC_PUBLISHPRIMARY, "PublishPrimaryEmail", 0);
LoadDBCheckState(ppro, hwndDlg, IDC_STATUSMSG_CLIST, "StatusMsgReplyCList", 0);
LoadDBCheckState(ppro, hwndDlg, IDC_STATUSMSG_VISIBLE, "StatusMsgReplyVisible", 0);
if (!ppro->getByte("StatusMsgReplyCList", 0))
EnableDlgItem(hwndDlg, IDC_STATUSMSG_VISIBLE, FALSE);
}
return TRUE;
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDC_DCALLOW_ANY:
case IDC_DCALLOW_CLIST:
case IDC_DCALLOW_AUTH:
case IDC_ADD_ANY:
case IDC_ADD_AUTH:
case IDC_WEBAWARE:
case IDC_PUBLISHPRIMARY:
case IDC_STATUSMSG_VISIBLE:
if ((HWND)lParam != GetFocus()) return 0;
break;
case IDC_STATUSMSG_CLIST:
if (IsDlgButtonChecked(hwndDlg, IDC_STATUSMSG_CLIST)) {
EnableDlgItem(hwndDlg, IDC_STATUSMSG_VISIBLE, TRUE);
LoadDBCheckState(ppro, hwndDlg, IDC_STATUSMSG_VISIBLE, "StatusMsgReplyVisible", 0);
}
else {
EnableDlgItem(hwndDlg, IDC_STATUSMSG_VISIBLE, FALSE);
CheckDlgButton(hwndDlg, IDC_STATUSMSG_VISIBLE, BST_UNCHECKED);
}
break;
default:
return 0;
}
OptDlgChanged(hwndDlg);
break;
case WM_NOTIFY:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
StoreDBCheckState(ppro, hwndDlg, IDC_WEBAWARE, "WebAware");
StoreDBCheckState(ppro, hwndDlg, IDC_PUBLISHPRIMARY, "PublishPrimaryEmail");
StoreDBCheckState(ppro, hwndDlg, IDC_STATUSMSG_CLIST, "StatusMsgReplyCList");
StoreDBCheckState(ppro, hwndDlg, IDC_STATUSMSG_VISIBLE, "StatusMsgReplyVisible");
if (IsDlgButtonChecked(hwndDlg, IDC_DCALLOW_AUTH))
ppro->setByte("DCType", 2);
else if (IsDlgButtonChecked(hwndDlg, IDC_DCALLOW_CLIST))
ppro->setByte("DCType", 1);
else
ppro->setByte("DCType", 0);
StoreDBCheckState(ppro, hwndDlg, IDC_ADD_AUTH, "Auth");
if (ppro->icqOnline()) {
PBYTE buf = NULL;
size_t buflen = 0;
ppackTLVWord(&buf, &buflen, 0x19A, !ppro->getByte("Auth", 1));
ppackTLVByte(&buf, &buflen, 0x212, ppro->getByte("WebAware", 0));
ppackTLVWord(&buf, &buflen, 0x1F9, ppro->getByte("PrivacyLevel", 1));
ppro->icq_changeUserDirectoryInfoServ(buf, buflen, DIRECTORYREQUEST_UPDATEPRIVACY);
SAFE_FREE((void**)&buf);
// Send a status packet to notify the server about the webaware setting
WORD wStatus = MirandaStatusToIcq(ppro->m_iStatus);
if (ppro->m_iStatus == ID_STATUS_INVISIBLE) {
if (ppro->m_bSsiEnabled)
ppro->updateServVisibilityCode(3);
ppro->icq_setstatus(wStatus, NULL);
}
else {
ppro->icq_setstatus(wStatus, NULL);
if (ppro->m_bSsiEnabled)
//.........这里部分代码省略.........