コード例 #1
0
	void OnRegisterClick(CCtrlButton*)
	{
		if (GetWindowTextLength(m_pw1.GetHwnd()) != 3 || GetWindowTextLength(m_pw2.GetHwnd()) != 3) {
			MessageBox(NULL, TranslateT("Please correctly specify your registration code received by SMS"), PRODUCT_NAME, MB_ICONEXCLAMATION);
			return;
		}

		char code[10];
		GetWindowTextA(m_pw1.GetHwnd(), code, 4);
		GetWindowTextA(m_pw2.GetHwnd(), code + 3, 4);

		string password;
		ptrA cc(m_cc.GetTextA()), number(m_login.GetTextA());
		if (m_proto->Register(REG_STATE_REG_CODE, string(cc), string(number), string(code), password)) {
			m_proto->setString(WHATSAPP_KEY_PASS, password.c_str());
			MessageBox(NULL, TranslateT(szPasswordSet), PRODUCT_NAME, MB_ICONWARNING);
		}
	}
コード例 #2
0
	virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
	{
		switch (msg) {
		case WM_FOCUSTEXTBOX:
			SetFocus(m_profileName.GetHwnd());
			break;

		case WM_INPUTCHANGED: // when input in the edit box changes
			NotifyChange();
			m_btnOk.Enable(GetWindowTextLength(m_profileName.GetHwnd()) > 0);
			break;

		case WM_SHOWWINDOW:
			if (wParam) {
				m_btnOk.SetText(TranslateT("&Create"));
				SendMessage(m_hwnd, WM_INPUTCHANGED, 0, 0);
			}
			break;
		}
		return CDlgBase::DlgProc(msg, wParam, lParam);
	}
コード例 #3
0
	void onOk(CCtrlButton*)
	{
		if (!m_proto->icqOnline())
			return;

		DWORD dwUin;
		uid_str szUid;
		if (m_proto->getContactUid(m_hContact, &dwUin, &szUid))
			return; // Invalid contact

		char *szReason = GetWindowTextUtf(m_auth.GetHwnd());
		m_proto->icq_sendAuthReqServ(dwUin, szUid, szReason);
		SAFE_FREE((void**)&szReason);

		// auth bug fix (thx Bio)
		if (m_proto->m_bSsiEnabled && dwUin)
			m_proto->resetServContactAuthState(m_hContact);

		EndDialog(m_hwnd, 0);
	}
コード例 #4
0
ファイル: profilemanager.cpp プロジェクト: Seldom/miranda-ng
    virtual void OnInitDialog()
    {
        // what, no plugins?!
        if (arDbPlugins.getCount() == 0) {
            m_driverList.Enable(false);
            m_profileName.Enable(false);
            ShowWindow(m_warning.GetHwnd(), TRUE);
        }
        else {
            for (int i = 0; i < arDbPlugins.getCount(); i++) {
                DATABASELINK *p = arDbPlugins[i];
                m_driverList.AddString(TranslateTS(p->szFullName), (LPARAM)p);
            }
        }

        // default item
        m_driverList.SetCurSel(0);

        // subclass the profile name box
        mir_subclassWindow(m_profileName.GetHwnd(), ProfileNameValidate);

        // decide if there is a default profile name given in the INI and if it should be used
        if (m_pd->noProfiles || (shouldAutoCreate(m_pd->ptszProfile) && _taccess(m_pd->ptszProfile, 0))) {
            TCHAR *profile = _tcsrchr(m_pd->ptszProfile, '\\');
            if (profile) ++profile;
            else profile = m_pd->ptszProfile;

            TCHAR *p = _tcsrchr(profile, '.');
            TCHAR c = 0;
            if (p) {
                c = *p;
                *p = 0;
            }

            m_profileName.SetText(profile);
            if (c) *p = c;
        }

        // focus on the textbox
        PostMessage(m_hwnd, WM_FOCUSTEXTBOX, 0, 0);
    }