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


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

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


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

示例1: DlgProcAccMgrUI

static INT_PTR CALLBACK DlgProcAccMgrUI(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);

            DBVARIANT dbv;
            if (!proto->getTString("Place", &dbv)) {
                SetDlgItemText(hwndDlg, IDC_PLACE, dbv.ptszVal);
                db_free(&dbv);
            }
        }
        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:
                SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
            }
        }
        break;

    case WM_NOTIFY:
        if (((LPNMHDR)lParam)->code == (UINT)PSN_APPLY) {
            char  password[100], szEmail[MSN_MAX_EMAIL_LEN];
            DBVARIANT dbv;

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

            GetDlgItemTextA(hwndDlg, IDC_HANDLE, szEmail, _countof(szEmail));
            if (mir_strcmp(szEmail, proto->MyOptions.szEmail)) {
                mir_strcpy(proto->MyOptions.szEmail, szEmail);
                proto->setString("e-mail", szEmail);
                proto->setString("wlid", szEmail);
                proto->setDword("netId", (proto->MyOptions.netId = proto->GetMyNetID()));
            }

            GetDlgItemTextA(hwndDlg, IDC_PASSWORD, password, _countof(password));
            if (!proto->getString("Password", &dbv)) {
                if (mir_strcmp(password, dbv.pszVal))
                    proto->setString("Password", password);
                db_free(&dbv);
            }
            else proto->setString("Password", password);

            TCHAR szPlace[64];
            GetDlgItemText(hwndDlg, IDC_PLACE, szPlace, _countof(szPlace));
            if (szPlace[0])
                proto->setTString("Place", szPlace);
            else
                proto->delSetting("Place");

            return TRUE;
        }
        break;
    }

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

示例2: SetDlgItemTextA

static INT_PTR CALLBACK DlgProcMsnConnOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
    DBVARIANT dbv;

    switch (msg) {
    case WM_INITDIALOG:
        TranslateDialogDefault(hwndDlg);
        {
            SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
            CMsnProto* proto = (CMsnProto*)lParam;

            if (!proto->getString("DirectServer", &dbv)) {
                SetDlgItemTextA(hwndDlg, IDC_DIRECTSERVER, dbv.pszVal);
                db_free(&dbv);
            }
            else SetDlgItemTextA(hwndDlg, IDC_DIRECTSERVER, MSN_DEFAULT_LOGIN_SERVER);

            if (!proto->getString("GatewayServer", &dbv)) {
                SetDlgItemTextA(hwndDlg, IDC_GATEWAYSERVER, dbv.pszVal);
                db_free(&dbv);
            }
            else SetDlgItemTextA(hwndDlg, IDC_GATEWAYSERVER, MSN_DEFAULT_GATEWAY);

            CheckDlgButton(hwndDlg, IDC_SLOWSEND, proto->getByte("SlowSend", 0) ? BST_CHECKED : BST_UNCHECKED);

            SendDlgItemMessage(hwndDlg, IDC_HOSTOPT, CB_ADDSTRING, 0, (LPARAM)TranslateT("Automatically obtain host/port"));
            SendDlgItemMessage(hwndDlg, IDC_HOSTOPT, CB_ADDSTRING, 0, (LPARAM)TranslateT("Manually specify host/port"));
            SendDlgItemMessage(hwndDlg, IDC_HOSTOPT, CB_ADDSTRING, 0, (LPARAM)TranslateT("Disable"));

            unsigned gethst = proto->getByte("AutoGetHost", 1);
            if (gethst < 2) gethst = !gethst;

            char ipaddr[256] = "";
            if (gethst == 1)
                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));
//.........这里部分代码省略.........
开发者ID:,项目名称:,代码行数:101,代码来源:


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