virtual void OnDestroy() { LRESULT curSel = m_servicePlugs.GetCurSel(); if (curSel != -1) { int idx = m_servicePlugs.GetItemData(curSel); if (idx != -1) SetServiceModePlugin(servicePlugins[idx]); } DestroyIcon((HICON)SendMessage(m_hwnd, WM_SETICON, ICON_SMALL, 0)); DestroyIcon((HICON)SendMessage(m_hwnd, WM_SETICON, ICON_BIG, 0)); }
void OnOk(CCtrlButton*) { MCONTACT hContact = INVALID_CONTACT_ID; switch (m_acs.handleType) { case HANDLE_EVENT: { DBEVENTINFO dbei = { sizeof(dbei) }; db_event_get(m_acs.hDbEvent, &dbei); hContact = (MCONTACT)CallProtoServiceInt(NULL, dbei.szModule, PS_ADDTOLISTBYEVENT, 0, (LPARAM)m_acs.hDbEvent); } break; case HANDLE_SEARCHRESULT: hContact = (MCONTACT)CallProtoServiceInt(NULL, m_acs.szProto, PS_ADDTOLIST, 0, (LPARAM)m_acs.psr); break; case HANDLE_CONTACT: hContact = m_acs.hContact; break; } if (hContact == NULL) return; ptrT szHandle(m_myHandle.GetText()); if (mir_tstrlen(szHandle)) db_set_ts(hContact, "CList", "MyHandle", szHandle); int item = m_group.GetCurSel(); if (item > 0) CallService(MS_CLIST_CONTACTCHANGEGROUP, hContact, m_group.GetItemData(item)); db_unset(hContact, "CList", "NotOnList"); if (m_chkAdded.GetState()) CallContactService(hContact, PSS_ADDED, 0, 0); if (m_chkAuth.GetState()) { DWORD flags = CallProtoServiceInt(NULL, m_acs.szProto, PS_GETCAPS, PFLAGNUM_4, 0); if (flags & PF4_NOCUSTOMAUTH) CallContactService(hContact, PSS_AUTHREQUEST, 0, 0); else CallContactService(hContact, PSS_AUTHREQUEST, 0, ptrT(m_authReq.GetText())); } if (m_chkOpen.GetState()) CallService(MS_CLIST_CONTACTDOUBLECLICKED, hContact, 0); }
virtual void OnApply() { LRESULT curSel = m_driverList.GetCurSel(); if (curSel == -1) return; // should never happen ptrT szName(m_profileName.GetText()); if (szName == 0) return; // profile placed in "profile_name" subfolder mir_sntprintf(m_pd->ptszProfile, MAX_PATH, _T("%s\\%s\\%s.dat"), m_pd->ptszProfileDir, szName, szName); m_pd->newProfile = 1; m_pd->dblink = (DATABASELINK *)m_driverList.GetItemData(curSel); if (CreateProfile(m_pd->ptszProfile, m_pd->dblink) == 0) SetWindowLongPtr(m_hwnd, DWLP_MSGRESULT, PSNRET_INVALID_NOCHANGEPAGE); else m_pd->bRun = true; }