开发工具:
文件大小: 12kb
下载次数: 0
上传时间: 2010-12-19
详细说明: 飞鸽传书的代码 #include #include "tlib.h" #include "resource.h" #include "ipmsg.h" #include "msgstr.h" TSetupDlg::TSetupDlg(Cfg *_cfg, THosts *_hosts, TWin *_parent) : TDlg(SETUP_DIALOG, _parent) { cfg = _cfg; hosts = _hosts; } TSetupDlg::~TSetupDlg() { } BOOL TSetupDlg::EvCreate(LPARAM lParam) { SetDlgIcon(hWnd); SetData(); if (rect.left == CW_USEDEFAULT) { GetWindowRect(&rect); int cx = ::GetSystemMetrics(SM_CXFULLSCREEN), cy = ::GetSystemMetrics(SM_CYFULLSC REEN); int xsize = rect.right - rect.left, ysize = rect.bottom - rect.top; int x = (cx - xsize)/2, y = (cy - ysize)/2; if (x + xsize > cx) x = cx - xsize; if (y + ysize > cy) y = cy - ysize; MoveWindow(x < 0 ? 0 : x, y < 0 ? 0 : y, xsize, ysize, FALSE); } else MoveWindow(rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, FALSE); SetForegroundWindow(); return TRUE; } BOOL TSetupDlg::EvCommand(WORD wNotifyCode, WORD wID, LPARAM hWndCtl) { switch (wID) { case IDOK: case SET_BUTTON: GetData(); // SET_BUTTON 偼慡cfg-write ... for debug cfg->WriteRegistry(wID == IDOK ? (CFG_GENERAL|CFG_BROADCAST) : CFG_ALL); if (wID == IDOK) EndDialog(TRUE); return TRUE; case ADD_BUTTON: { char buf[MAX_PATH], buf2[MAX_PATH]; if (GetDlgItemText(BROADCAST_EDIT, buf, sizeof(buf)) <= 0) return TRUE; if (ResolveAddr(buf) == 0) return MessageBox(CANTRESOLVE_MSGSTR), TRUE; for (int cnt=0; SendDlgItemMessage(BROADCAST_LIST, LB_GETTEXT, cnt, (LPARAM)buf2) != LB_ERR; cnt++) if (_stricmp(buf, buf2) == 0) return TRUE; SendDlgItemMessage(BROADCAST_LIST, LB_ADDSTRING, 0, (LPARAM)buf); SetDlgItemText(BROADCAST_EDIT, ""); } return TRUE; case DEL_BUTTON: { char buf[MAX_PATH]; int index; while ((int)SendDlgItemMessage(BROADCAST_LIST, LB_GETSELCOUNT, 0, 0) > 0) { if (SendDlgItemMessage(BROADCAST_LIST, LB_GETSELITEMS, 1, (LPARAM)&index) != 1) break; SendDlgItemMessage(BROADCAST_LIST, LB_GETTEXT, (WPARAM)index, (LPARAM)buf); SetDlgItemText(BROADCAST_EDIT, buf); if (SendDlgItemMessage(BROADCAST_LIST, LB_DELETESTRING, (WPARAM)index, (LPARAM)buf) == LB_ERR) break; } } return TRUE; case LOG_BUTTON: TLogDlg(cfg, this).Exec(); return TRUE; case PASSWORD_BUTTON: TPasswdChangeDlg(cfg, this).Exec(); return TRUE; case URL_BUTTON: TUrlDlg(cfg, this).Exec(); return TRUE; case IDCANCEL: case IDNO: EndDialog(FALSE); return TRUE; } return FALSE; } void TSetupDlg::SetData(void) { SetDlgItemText(GROUP_COMBO, cfg->GroupNameStr); SetDlgItemText(NICKNAME_EDIT, cfg->NickNameStr); SendDlgItemMessage(OPEN_CHECK, BM_SETCHECK, cfg->OpenCheck, 0); SendDlgItemMessage(NOPOPUP_CHECK, BM_SETCHECK, cfg->NoPopupCheck, 0); SendDlgItemMessage(NOBEEP_CHECK, BM_SETCHECK, cfg->NoBeep, 0); SendDlgItemMessage(QUOTE_CHECK, BM_SETCHECK, cfg->QuoteCheck, 0); SendDlgItemMessage(SECRET_CHECK, BM_SETCHECK, cfg->SecretCheck, 0); for (TBroadcastObj *obj=cfg->broadcastList.Top(); obj; obj=cfg->broadcastList.Next(obj)) SendDlgItemMessage(BROADCAST_LIST, LB_ADDSTRING, 0, (LPARAM)obj->Host()); for (int cnt=0; cnt < hosts->HostCnt(); cnt++) { Host *host = hosts->GetHost(cnt); if (*host->groupName && SendDlgItemMessage(GROUP_COMBO, CB_FINDSTRING, (WPARAM)-1, (LPARAM)host->groupName) == CB_ERR) SendDlgItemMessage(GROUP_COMBO, CB_ADDSTRING, (WPARAM)0, (LPARAM)host->groupName); } SendDlgItemMessage(DIALUP_CHECK, BM_SETCHECK, cfg->DialUpCheck, 0); } ...展开收缩
(系统自动生成,下载前可以参看下载内容)
下载文件列表
相关说明
- 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
- 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。
- 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
- 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
- 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
- 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.