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


C++ CMsnProto类代码示例

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


在下文中一共展示了CMsnProto类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: MSN_OnPrebuildContactMenu

static int MSN_OnPrebuildContactMenu(WPARAM wParam, LPARAM lParam)
{
	CMsnProto* ppro = GetProtoInstanceByHContact((HANDLE)wParam);
	if (ppro)
		ppro->OnPrebuildContactMenu(wParam, lParam);
	else
	{
		sttEnableMenuItem(hBlockMenuItem, false);
		sttEnableMenuItem(hLiveSpaceMenuItem, false);
		sttEnableMenuItem(hNetmeetingMenuItem, false);
		sttEnableMenuItem(hChatInviteMenuItem, false);
		sttEnableMenuItem(hOpenInboxMenuItem, false);
	}

	return 0;
}
开发者ID:TonyAlloa,项目名称:miranda-dev,代码行数:16,代码来源:msn_menu.cpp

示例3: MSN_OnPrebuildContactMenu

static int MSN_OnPrebuildContactMenu(WPARAM wParam, LPARAM lParam)
{
	CMsnProto* ppro = GetProtoInstanceByHContact(wParam);
	if (ppro)
		ppro->OnPrebuildContactMenu(wParam, lParam);
	else {
		Menu_ShowItem(hBlockMenuItem, false);
		Menu_ShowItem(hLiveSpaceMenuItem, false);
#ifdef OBSOLETE
		Menu_ShowItem(hNetmeetingMenuItem, false);
#endif
		Menu_ShowItem(hChatInviteMenuItem, false);
		Menu_ShowItem(hOpenInboxMenuItem, false);
	}

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

示例4: MsnMenuSendHotmail

static INT_PTR MsnMenuSendHotmail(WPARAM wParam, LPARAM lParam)
{
	CMsnProto* ppro = GetProtoInstanceByHContact(wParam);
	return (ppro) ? ppro->MsnSendHotmail(wParam, lParam) : 0;
}
开发者ID:,项目名称:,代码行数:5,代码来源:

示例5: MsnMenuViewProfile

static INT_PTR MsnMenuViewProfile(WPARAM wParam, LPARAM lParam)
{
	CMsnProto* ppro = GetProtoInstanceByHContact(wParam);
	return (ppro) ? ppro->MsnViewProfile(wParam, lParam) : 0;
}
开发者ID:,项目名称:,代码行数:5,代码来源:

示例6: MsnMenuBlockCommand

static INT_PTR MsnMenuBlockCommand(WPARAM wParam, LPARAM lParam)
{
	CMsnProto* ppro = GetProtoInstanceByHContact(wParam);
	return (ppro) ? ppro->MsnBlockCommand(wParam, lParam) : 0;
}
开发者ID:,项目名称:,代码行数:5,代码来源:

示例7: MsnMenuSendNetMeeting

static INT_PTR MsnMenuSendNetMeeting(WPARAM wParam, LPARAM lParam)
{
	CMsnProto* ppro = GetProtoInstanceByHContact((HANDLE)wParam);
	return (ppro) ? ppro->MsnSendNetMeeting(wParam, lParam) : 0;
}
开发者ID:TonyAlloa,项目名称:miranda-dev,代码行数:5,代码来源:msn_menu.cpp

示例8: DlgProcMsnOpts

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,代码来源:

示例9: 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,代码来源:

示例10: DlgProcHotmailPopupOpts

static INT_PTR CALLBACK DlgProcHotmailPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
    static bool bEnabled;
    CMsnProto* proto = (CMsnProto*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);

    switch (msg) {
    case WM_INITDIALOG:
        TranslateDialogDefault(hwndDlg);
        bEnabled = false;

        SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
        proto = (CMsnProto*)lParam;
        CheckDlgButton(hwndDlg, IDC_DISABLEHOTMAILPOPUP, proto->getByte("DisableHotmail", 0) ? BST_UNCHECKED : BST_CHECKED);
        CheckDlgButton(hwndDlg, IDC_DISABLEHOTMAILTRAY, proto->getByte("DisableHotmailTray", 1) ? BST_UNCHECKED : BST_CHECKED);
        CheckDlgButton(hwndDlg, IDC_DISABLEHOTMAILCL, proto->getByte("DisableHotmailCL", 0) ? BST_UNCHECKED : BST_CHECKED);
        CheckDlgButton(hwndDlg, IDC_DISABLEHOTJUNK, proto->getByte("DisableHotmailJunk", 0) ? BST_CHECKED : BST_UNCHECKED);
        CheckDlgButton(hwndDlg, IDC_NOTIFY_ENDSESSION, proto->getByte("EnableSessionPopup", 0) ? BST_CHECKED : BST_UNCHECKED);
        CheckDlgButton(hwndDlg, IDC_NOTIFY_FIRSTMSG, proto->getByte("EnableDeliveryPopup", 0) ? BST_CHECKED : BST_UNCHECKED);
        CheckDlgButton(hwndDlg, IDC_ERRORS_USING_POPUPS, proto->getByte("ShowErrorsAsPopups", 0) ? BST_CHECKED : BST_UNCHECKED);

        bEnabled = true;
        return TRUE;

    case WM_COMMAND:
        switch (LOWORD(wParam)) {
        case IDC_DISABLEHOTMAILPOPUP:
        case IDC_DISABLEHOTMAILTRAY:
        case IDC_DISABLEHOTMAILCL:
        case IDC_DISABLEHOTJUNK:
        case IDC_NOTIFY_ENDSESSION:
        case IDC_NOTIFY_FIRSTMSG:
        case IDC_ERRORS_USING_POPUPS:
            if (bEnabled)
                SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
            break;
        }
        break;

    case WM_NOTIFY: //Here we have pressed either the OK or the APPLY button.
        switch (((LPNMHDR)lParam)->idFrom) {
        case 0:
            switch (((LPNMHDR)lParam)->code) {
            case PSN_RESET:
                proto->LoadOptions();
                return TRUE;

            case PSN_APPLY:
                proto->MyOptions.ShowErrorsAsPopups = IsDlgButtonChecked(hwndDlg, IDC_ERRORS_USING_POPUPS) != 0;
                proto->setByte("ShowErrorsAsPopups", proto->MyOptions.ShowErrorsAsPopups);

                proto->setByte("DisableHotmail", IsDlgButtonChecked(hwndDlg, IDC_DISABLEHOTMAILPOPUP) ? FALSE : TRUE);
                proto->setByte("DisableHotmailCL", IsDlgButtonChecked(hwndDlg, IDC_DISABLEHOTMAILCL) ? FALSE : TRUE);
                proto->setByte("DisableHotmailTray", IsDlgButtonChecked(hwndDlg, IDC_DISABLEHOTMAILTRAY) ? FALSE : TRUE);
                proto->setByte("DisableHotmailJunk", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DISABLEHOTJUNK));
                proto->setByte("EnableDeliveryPopup", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_FIRSTMSG));
                proto->setByte("EnableSessionPopup", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_ENDSESSION));

                MCONTACT hContact = proto->MSN_HContactFromEmail(proto->MyOptions.szEmail);
                if (hContact)
                    proto->displayEmailCount(hContact);
                return TRUE;
            }
            break;
        }
        break;
    }

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

示例11: DlgProcMsnConnOpts

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