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


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

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


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

示例1: DlgProcSetNickname

static INT_PTR CALLBACK DlgProcSetNickname(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
	switch (msg)
	{
		case WM_INITDIALOG:
		{
			TranslateDialogDefault(hwndDlg);

			SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
			CMsnProto* proto = (CMsnProto*)lParam;

			SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)LoadIconEx("main", true));
			SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)LoadIconEx("main"));
			SendMessage(GetDlgItem(hwndDlg, IDC_NICKNAME), EM_LIMITTEXT, 129, 0);

			DBVARIANT dbv;
			if (!proto->getTString("Nick", &dbv)) {
				SetDlgItemText(hwndDlg, IDC_NICKNAME, dbv.ptszVal);
				MSN_FreeVariant(&dbv);
			}
			return TRUE;
		}
		case WM_COMMAND:
			switch(wParam)
			{
			case IDOK: 
				{
					CMsnProto* proto = (CMsnProto*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
					if (proto->msnLoggedIn) 
					{
						TCHAR str[130];
						GetDlgItemText(hwndDlg, IDC_NICKNAME, str, SIZEOF(str));
						proto->MSN_SendNickname(str);
					}
				}

				case IDCANCEL:
					DestroyWindow(hwndDlg);
					break;
			}
			break;

		case WM_CLOSE:
			DestroyWindow(hwndDlg);
			break;

		case WM_DESTROY:
			ReleaseIconEx("main");
			ReleaseIconEx("main", true);
			break;
	}
	return FALSE;
}
开发者ID:TonyAlloa,项目名称:miranda-dev,代码行数:53,代码来源:msn_menu.cpp

示例2: CheckDlgButton


//.........这里部分代码省略.........
                    tSelectLen += mir_strlen(szFile);

                    OPENFILENAMEA ofn = { 0 };
                    ofn.lStructSize = sizeof(ofn);
                    ofn.hwndOwner = hwndDlg;
                    ofn.nMaxFile = _countof(szFile);
                    ofn.lpstrFile = szFile;
                    ofn.Flags = OFN_FILEMUSTEXIST | OFN_NOCHANGEDIR;
                    if (GetOpenFileNameA(&ofn) != TRUE)
                        break;

                    if (strchr(szFile, ' ') != NULL) {
                        char tmpBuf[MAX_PATH + 2];
                        mir_snprintf(tmpBuf, _countof(tmpBuf), "\"%s\"", szFile);
                        mir_strcpy(szFile, tmpBuf);
                    }

                    SendMessage(tEditField, EM_SETSEL, 0, tSelectLen);
                    SendMessageA(tEditField, EM_REPLACESEL, TRUE, LPARAM(szFile));
                    SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
                }
            }
        }
        break;

    case WM_NOTIFY:
        if (((LPNMHDR)lParam)->code == (UINT)PSN_APPLY) {
            bool reconnectRequired = false;
            TCHAR screenStr[MAX_PATH];
            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(_strlwr(szEmail), proto->MyOptions.szEmail)) {
                reconnectRequired = true;
                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)) {
                    reconnectRequired = true;
                    proto->setString("Password", password);
                }
                db_free(&dbv);
            }
            else {
                reconnectRequired = true;
                proto->setString("Password", password);
            }

#ifdef OBSOLETE
            GetDlgItemText(hwndDlg, IDC_HANDLE2, screenStr, _countof(screenStr));
            if (!proto->getTString("Nick", &dbv)) {
                if (mir_tstrcmp(dbv.ptszVal, screenStr))
                    proto->MSN_SendNickname(screenStr);
                db_free(&dbv);
            }
            else proto->MSN_SendNickname(screenStr);

            BYTE mblsnd = IsDlgButtonChecked(hwndDlg, IDC_MOBILESEND) == BST_CHECKED;
            if (mblsnd != proto->getByte("MobileAllowed", 0)) {
                proto->msnNsThread->sendPacket("PRP", "MOB %c", mblsnd ? 'Y' : 'N');
                proto->MSN_SetServerStatus(proto->m_iStatus);
            }

            unsigned tValue = IsDlgButtonChecked(hwndDlg, IDC_DISABLE_ANOTHER_CONTACTS);
            if (tValue != proto->msnOtherContactsBlocked && proto->msnLoggedIn) {
                proto->msnOtherContactsBlocked = tValue;
                proto->msnNsThread->sendPacket("BLP", tValue ? "BL" : "AL");
                proto->MSN_ABUpdateAttr(NULL, "MSN.IM.BLP", tValue ? "0" : "1");
                break;
            }
#endif

            proto->setByte("SendFontInfo", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SENDFONTINFO));
            proto->setByte("RunMailerOnHotmail", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_RUN_APP_ON_HOTMAIL));
            proto->setByte("ManageServer", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_MANAGEGROUPS));

            GetDlgItemText(hwndDlg, IDC_MAILER_APP, screenStr, _countof(screenStr));
            proto->setTString("MailerPath", screenStr);

            if (reconnectRequired && proto->msnLoggedIn)
                MessageBox(hwndDlg,
                           TranslateT("The changes you have made require you to reconnect to the MSN Messenger network before they take effect"),
                           TranslateT("MSN Options"), MB_OK);

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

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


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