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


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

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


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

示例1: CheckDlgButton

static INT_PTR CALLBACK DlgProcMsnOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
    switch (msg) {
    case WM_INITDIALOG:
        TranslateDialogDefault(hwndDlg);
        {
            SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
            CMsnProto* proto = (CMsnProto*)lParam;

            SetDlgItemTextA(hwndDlg, IDC_HANDLE, proto->MyOptions.szEmail);

            char tBuffer[MAX_PATH];
            if (!db_get_static(NULL, proto->m_szModuleName, "Password", tBuffer, sizeof(tBuffer))) {
                tBuffer[16] = 0;
                SetDlgItemTextA(hwndDlg, IDC_PASSWORD, tBuffer);
            }
            SendDlgItemMessage(hwndDlg, IDC_PASSWORD, EM_SETLIMITTEXT, 16, 0);

            HWND wnd = GetDlgItem(hwndDlg, IDC_HANDLE2);
            DBVARIANT dbv;
            if (!proto->getTString("Nick", &dbv)) {
                SetWindowText(wnd, dbv.ptszVal);
                db_free(&dbv);
            }
            EnableWindow(wnd, proto->msnLoggedIn);
            EnableWindow(GetDlgItem(hwndDlg, IDC_MOBILESEND), proto->msnLoggedIn &&
                         proto->getByte("MobileEnabled", 0) && proto->getByte("MobileAllowed", 0));

            CheckDlgButton(hwndDlg, IDC_MOBILESEND, proto->getByte("MobileAllowed", 0) ? BST_CHECKED : BST_UNCHECKED);
            CheckDlgButton(hwndDlg, IDC_SENDFONTINFO, proto->getByte("SendFontInfo", 1) ? BST_CHECKED : BST_UNCHECKED);
            CheckDlgButton(hwndDlg, IDC_MANAGEGROUPS, proto->getByte("ManageServer", 1) ? BST_CHECKED : BST_UNCHECKED);

            int tValue = proto->getByte("RunMailerOnHotmail", 0);
            CheckDlgButton(hwndDlg, IDC_RUN_APP_ON_HOTMAIL, tValue ? BST_CHECKED : BST_UNCHECKED);
            EnableWindow(GetDlgItem(hwndDlg, IDC_MAILER_APP), tValue);
            EnableWindow(GetDlgItem(hwndDlg, IDC_ENTER_MAILER_APP), tValue);

            if (!db_get_static(NULL, proto->m_szModuleName, "MailerPath", tBuffer, sizeof(tBuffer)))
                SetDlgItemTextA(hwndDlg, IDC_MAILER_APP, tBuffer);

            if (!proto->msnLoggedIn) {
                EnableWindow(GetDlgItem(hwndDlg, IDC_MANAGEGROUPS), FALSE);
                EnableWindow(GetDlgItem(hwndDlg, IDC_DISABLE_ANOTHER_CONTACTS), FALSE);
            }
            else CheckDlgButton(hwndDlg, IDC_DISABLE_ANOTHER_CONTACTS, proto->msnOtherContactsBlocked ? BST_CHECKED : BST_UNCHECKED);
        }
        return TRUE;

    case WM_COMMAND:
        if (LOWORD(wParam) == IDC_NEWMSNACCOUNTLINK) {
            Utils_OpenUrl("https://signup.live.com");
            return TRUE;
        }

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

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

            case IDC_MANAGEGROUPS:
                if (IsDlgButtonChecked(hwndDlg, IDC_MANAGEGROUPS)) {
                    if (IDYES == MessageBox(hwndDlg,
                                            TranslateT("Server groups import may change your contact list layout after next login. Do you want to upload your groups to the server?"),
                                            TranslateT("MSN Protocol"), MB_YESNOCANCEL)) {
                        CMsnProto* proto = (CMsnProto*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
                        proto->MSN_UploadServerGroups(NULL);
                    }
                }
                SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
                break;

            case IDC_RUN_APP_ON_HOTMAIL:
            {
                BOOL tIsChosen = IsDlgButtonChecked(hwndDlg, IDC_RUN_APP_ON_HOTMAIL);
                EnableWindow(GetDlgItem(hwndDlg, IDC_MAILER_APP), tIsChosen);
                EnableWindow(GetDlgItem(hwndDlg, IDC_ENTER_MAILER_APP), tIsChosen);
                SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
            }
            break;

            case IDC_ENTER_MAILER_APP:
                char szFile[MAX_PATH + 2];
                {
                    HWND tEditField = GetDlgItem(hwndDlg, IDC_MAILER_APP);

//.........这里部分代码省略.........
开发者ID:,项目名称:,代码行数:101,代码来源:


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