当前位置: 首页>>代码示例>>C++>>正文


C++ CMsnProto::ForkThread方法代码示例

本文整理汇总了C++中CMsnProto::ForkThread方法的典型用法代码示例。如果您正苦于以下问题:C++ CMsnProto::ForkThread方法的具体用法?C++ CMsnProto::ForkThread怎么用?C++ CMsnProto::ForkThread使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CMsnProto的用法示例。


在下文中一共展示了CMsnProto::ForkThread方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SetDlgItemTextA


//.........这里部分代码省略.........
                if (db_get_static(NULL, proto->m_szModuleName, "YourHost", ipaddr, sizeof(ipaddr)))
                    gethst = 0;

            if (gethst == 0)
                strncpy_s(ipaddr, (proto->msnLoggedIn ? proto->MyConnection.GetMyExtIPStr() : ""), _TRUNCATE);

            SendDlgItemMessage(hwndDlg, IDC_HOSTOPT, CB_SETCURSEL, gethst, 0);
            if (ipaddr[0])
                SetDlgItemTextA(hwndDlg, IDC_YOURHOST, ipaddr);
            else
                SetDlgItemText(hwndDlg, IDC_YOURHOST, TranslateT("IP info available only after login"));
            EnableWindow(GetDlgItem(hwndDlg, IDC_YOURHOST), gethst == 1);
        }
        return TRUE;

    case WM_COMMAND:
        switch (LOWORD(wParam)) {
        case IDC_RESETSERVER:
            SetDlgItemTextA(hwndDlg, IDC_DIRECTSERVER, MSN_DEFAULT_LOGIN_SERVER);
            SetDlgItemTextA(hwndDlg, IDC_GATEWAYSERVER, MSN_DEFAULT_GATEWAY);
            SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
            break;
        }

        if (HIWORD(wParam) == EN_CHANGE && (HWND)lParam == GetFocus())
            switch (LOWORD(wParam)) {
            case IDC_DIRECTSERVER:
            case IDC_GATEWAYSERVER:
            case IDC_YOURHOST:
                SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
            }

        if (HIWORD(wParam) == CBN_SELCHANGE && LOWORD(wParam) == IDC_HOSTOPT) {
            unsigned gethst = SendMessage((HWND)lParam, CB_GETCURSEL, 0, 0);
            EnableWindow(GetDlgItem(hwndDlg, IDC_YOURHOST), gethst == 1);
            SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
        }

        if (HIWORD(wParam) == BN_CLICKED) {
            switch (LOWORD(wParam)) {
            case IDC_SLOWSEND:
                SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
                break;
            }
        }
        break;

    case WM_NOTIFY:
        if (((LPNMHDR)lParam)->code == (UINT)PSN_APPLY) {
            char str[MAX_PATH];

            CMsnProto* proto = (CMsnProto*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);

            GetDlgItemTextA(hwndDlg, IDC_DIRECTSERVER, str, _countof(str));
            if (mir_strcmp(str, MSN_DEFAULT_LOGIN_SERVER))
                proto->setString("DirectServer", str);
            else
                proto->delSetting("DirectServer");

            GetDlgItemTextA(hwndDlg, IDC_GATEWAYSERVER, str, _countof(str));
            if (mir_strcmp(str, MSN_DEFAULT_GATEWAY))
                proto->setString("GatewayServer", str);
            else
                proto->delSetting("GatewayServer");

            proto->setByte("SlowSend", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SLOWSEND));
            if (proto->getByte("SlowSend", FALSE)) {
                if (db_get_dw(NULL, "SRMsg", "MessageTimeout", 60000) < 60000 ||
                        db_get_dw(NULL, "SRMM", "MessageTimeout", 60000) < 60000) {
                    MessageBox(NULL, TranslateT("MSN Protocol requires message timeout to be not less then 60 sec. Correct the timeout value."),
                               TranslateT("MSN Protocol"), MB_OK | MB_ICONINFORMATION);
                }
            }

#ifdef OBSOLETE
            unsigned gethst2 = proto->getByte("AutoGetHost", 1);

#endif
            unsigned gethst = SendDlgItemMessage(hwndDlg, IDC_HOSTOPT, CB_GETCURSEL, 0, 0);
            if (gethst < 2) gethst = !gethst;
            proto->setByte("AutoGetHost", (BYTE)gethst);

            if (gethst == 0) {
                GetDlgItemTextA(hwndDlg, IDC_YOURHOST, str, _countof(str));
                proto->setString("YourHost", str);
            }
            else proto->delSetting("YourHost");

#ifdef OBSOLETE
            if (gethst != gethst2)
                proto->ForkThread(&CMsnProto::MSNConnDetectThread, NULL);
#endif

            proto->LoadOptions();
            return TRUE;
        }
    }

    return FALSE;
}
开发者ID:,项目名称:,代码行数:101,代码来源:


注:本文中的CMsnProto::ForkThread方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。