int CZiMainFrame::OnClickRightMenu(TNotifyUI & msg) { CNodeList * pNode = 0; CNodeList * pNodeP = 0; CListUI * pList = static_cast<CListUI*>(msg.pSender); int nSel = pList->GetCurSel(); if(nSel < 0 || !pList->GetItemAt(nSel)) { return 0; } // 右键操作 pNode = (CNodeList *)pList->GetItemAt(nSel)->GetTag(); Assert(pNode); //TODO //发送命令道服务器端,等服务端验证成功后再做操作 //发送网络命令 switch(msg.wParam) { case Event_OpenItem: { CreateChatDailog(pNode); break; } case Event_ModifyItem: { OnModifyGroupName(pNode); break; } case Event_DeleteItem: { DelItem(pNode); } break; default: { Assert(0); break; } } return 0; }
LRESULT OnAddListItem(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { CListTextElementUI* pListElement = (CListTextElementUI*)lParam; CListUI* pList = static_cast<CListUI*>(m_pm.FindControl(_T("domainlist"))); if( pList ) pList->Add(pListElement); return 0; }
void CSettingDlg::OnBtnNetSegmentAdd() { CEditUI* pEditNetSegment = static_cast<CEditUI*>(m_PaintManager.FindControl(_T("edit_netsegment"))); CListUI* pListNetSegment = static_cast<CListUI*>(m_PaintManager.FindControl(_T("list_netsegment"))); ASSERT(pEditNetSegment != NULL && pListNetSegment != NULL); CDuiString strText = pEditNetSegment->GetText(); if (strText.IsEmpty()) { return ; } //DUI__Trace(_T("inet_addr(strText) = 0x%08X."), inet_addr(strText)); // inet_addr(strText) == INADDR_NONE 并不能判断,比如输入一个"1",inet_addr会返回0x01000000 [12/27/2014 ybt] if (!IsValidAddrString(strText)) { MessageBox(m_hWnd, _T("请输入正确的IP地址."), APPNAME_STR, MB_OK); return ; } pEditNetSegment->SetText(_T("")); CListLabelElementUI* pLableElement = new CListLabelElementUI; pLableElement->SetText(strText); pListNetSegment->Add(pLableElement); m_bNetworkChange = TRUE; }
LRESULT CWndTray::OnCreate( UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled ) { __super::OnCreate(uMsg, wParam, lParam, bHandled); CListUI *pList = static_cast<CListUI*>(m_PaintManager.FindControl(_T("menulist"))); pList->GetHeader()->SetVisible(false); return 0; }
void CSettingDlg::OnBtnNetSegmentDel() { CListUI* pListNetSegment = static_cast<CListUI*>(m_PaintManager.FindControl(_T("list_netsegment"))); ASSERT(pListNetSegment != NULL); if (pListNetSegment->GetCurSel() >= 0) { pListNetSegment->Remove(pListNetSegment->GetItemAt(pListNetSegment->GetCurSel())); m_bNetworkChange = TRUE; } }
IMPL_LUA_FUNC(LuaWindowExport, SetListCallback) { try { CLuaWindow* self; self = static_cast<CLuaWindow*>(LuaStatic::CheckUserData(l, 1)); CListUI* pList = static_cast<CListUI*>(LuaStatic::CheckUserData(l, 2)); pList->SetTextCallback(self); return 0; } catch (...) { DuiException(_T("LuaWindowExport::SetListCallback")); return 0; } }
void CFrameWnd::InitWindow() { // SetIcon(IDR_MAINFRAME); // 设置任务栏图标 CenterWindow(); // 初始化CActiveXUI控件 CActiveXUI* pActiveXUI = static_cast<CActiveXUI*>(m_PaintManager.FindControl(_T("ActiveXDemo1"))); if( pActiveXUI ) { IWebBrowser2* pWebBrowser = NULL; pActiveXUI->SetDelayCreate(false); // 相当于界面设计器里的DelayCreate属性改为FALSE,在duilib自带的FlashDemo里可以看到此属性为TRUE pActiveXUI->CreateControl(CLSID_WebBrowser); // 相当于界面设计器里的Clsid属性里填入{8856F961-340A-11D0-A96B-00C04FD705A2},建议用CLSID_WebBrowser,如果想看相应的值,请见<ExDisp.h> pActiveXUI->GetControl(IID_IWebBrowser2, (void**)&pWebBrowser); if( pWebBrowser != NULL ) { //pWebBrowser->Navigate(L"https://code.google.com/p/duilib/",NULL,NULL,NULL,NULL); pWebBrowser->Navigate(L"about:blank", NULL, NULL, NULL, NULL); pWebBrowser->Navigate(L"http://www.baidu.com/", NULL, NULL, NULL, NULL); // 由于谷歌时不时被墙,所以换成反应快的网站 pWebBrowser->Release(); } } // 初始化CProgressUI控件 CProgressUI* pProgress = static_cast<CProgressUI*>(m_PaintManager.FindControl(_T("ProgressDemo1"))); pProgress->SetValue(50); // 初始化CListUI控件 CDuiString str; CListUI* pList = static_cast<CListUI*>(m_PaintManager.FindControl(_T("ListDemo1"))); for (int i = 0; i < 100; i++) { CListTextElementUI* pListElement = new CListTextElementUI; pListElement->SetTag(i); pList->Add(pListElement); str.Format(_T("%d"), i); pListElement->SetText(0, str); pListElement->SetText(1, _T("haha")); } }
void CMainDialog::OnInit() { CListUI* pList = static_cast <CListUI*> (m_pm.FindControl(_T ("lstNormal"))); ASSERT(pList); if (pList) { pList->SetTextCallback(this); for (int i = 0; i < 100; ++i) { CListTextElementUI* pItem = new CListTextElementUI; m_arstrListString0 [i].Format(_T ("{i list_png.png}{/i}{x 4}%d"), i); m_arstrListString1 [i].Format(_T ("%d - 1"), i); m_arstrListString2 [i].Format(_T ("%d - 2"), i); pList->Add(pItem); } } AddComboboxItem (); AddTreeItem (); }
void CMonitoringUI::ShowMonitInfoList() { CDialogBuilder builder; CListContainerElementUI* SubList = (CListContainerElementUI*)(builder.Create(_T("xml//RegInfoList.xml"), (UINT)0, NULL, &m_PaintManager)); CListUI* pList = dynamic_cast<CListUI*>(m_PaintManager.FindControl(_T("Refer_InfoList"))); pList->Add(SubList); CControlUI* photoUI = dynamic_cast<CControlUI*>(m_PaintManager.FindSubControlByClass(SubList, DUI_CTR_CONTROL)); CLabelUI* lab_ID = dynamic_cast<CLabelUI*>(m_PaintManager.FindSubControlByClass(SubList, DUI_CTR_LABEL, 1)); CLabelUI* lab_similarity = dynamic_cast<CLabelUI*>(m_PaintManager.FindSubControlByClass(SubList, DUI_CTR_LABEL, 3)); CLabelUI* lab_time = dynamic_cast<CLabelUI*>(m_PaintManager.FindSubControlByClass(SubList, DUI_CTR_LABEL, 5)); std::string strName = std::string(_T("file = 'bmp/test")) + std::to_string(m_nBmp) + std::string(".bmp'"); photoUI->SetBkImage(strName.c_str()); lab_ID->SetText(std::to_string(m_testID).c_str()); lab_similarity->SetText("76%"); lab_time->SetText("2016-7-29 17:12:55"); if (m_testID % 3 == 0) { SubList->SetBkColor(0xFFFFDDDD); } m_testID++; }
void OnSearch() { struct Prama *prama = new Prama; CListUI* pList = static_cast<CListUI*>(m_pm.FindControl(_T("domainlist"))); CEditUI* pEdit = static_cast<CEditUI*>(m_pm.FindControl(_T("input"))); pEdit->SetEnabled(false); CStdString input = pEdit->GetText(); m_pSearch->SetEnabled(false); pList->RemoveAll(); domain.empty(); domain.resize(0); desc.empty(); desc.resize(0); DWORD dwThreadID = 0; pList->SetTextCallback(this);//[1] prama->hWnd = GetHWND(); prama->pList = pList; prama->pSearch = m_pSearch; prama->tDomain = input; HANDLE hThread = CreateThread(NULL,0,&ListMainForm::Search, (LPVOID)prama, 0,&dwThreadID); }
void MainDialog::Notify(TNotifyUI& msg) { if( msg.sType == _T("windowinit") ) OnPrepare(msg); else if( msg.sType == _T("click") ) { if( msg.pSender == m_pCloseBtn ) { PostQuitMessage(0); return; } else if( msg.pSender == m_pMinBtn ) { SendMessage(WM_SYSCOMMAND, SC_MINIMIZE, 0); return; } else if( msg.pSender == m_pMaxBtn ) { SendMessage(WM_SYSCOMMAND, SC_MAXIMIZE, 0); return; } else if( msg.pSender == m_pRestoreBtn ) { SendMessage(WM_SYSCOMMAND, SC_RESTORE, 0); return; } else if (msg.pSender->GetName() == _T("upload")) { } else if (msg.pSender == m_pClose) { } } else if(msg.sType==_T("setfocus")) { } else if( msg.sType == _T("itemexpand") ) { CTreeNodeUI* pNowNode = static_cast<CTreeNodeUI*>(msg.pSender); pNowNode->Select(true); CTreeViewUI* pTree = static_cast<CTreeViewUI*>(m_pm.FindControl(_T("tree"))); CListUI* pList = static_cast<CListUI*>(m_pm.FindControl(_T("file_list"))); g_bUpdateDir = false; if (!pNowNode->IsHasChild()) { g_bUpdateDir = true; } pList->RemoveAll(); WIN32_FIND_DATA FindFileData; HANDLE hListFile; TCHAR szFilePath[MAX_PATH]; lstrcpy(szFilePath,pNowNode->GetUserData()); lstrcat(szFilePath, _T("\\*")); hListFile = FindFirstFile(szFilePath,&FindFileData); if(hListFile==INVALID_HANDLE_VALUE) { return; } else { do { if(lstrcmp(FindFileData.cFileName,TEXT("."))==0|| lstrcmp(FindFileData.cFileName,TEXT(".."))==0) { continue; } SYSTEMTIME st; FileTimeToSystemTime(&FindFileData.ftLastWriteTime,&st); DWORDLONG dwlSize = (DWORDLONG)(FindFileData.nFileSizeHigh * (MAXDWORD+1)) + FindFileData.nFileSizeLow; DWORD dwSize = (DWORD)(dwlSize / 1024); if(FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { if (g_bUpdateDir) { CTreeNodeUI* pNode = new CTreeNodeUI; pNode->SetAttribute(_T("folderattr"),_T("padding=\"0,1,0,0\" width=\"36\" height=\"16\" normalimage=\"file='treeview_b.png' source='0,0,36,16'\" hotimage=\"file='treeview_b.png' source='36,0,72,16'\" selectedimage=\"file='treeview_a.png' source='0,0,36,16' selectedhotimage=\"file='treeview_a.png' source='36,0,72,16'\"")); pNowNode->AddChildNode(pNode); pNode->SetItemText(FindFileData.cFileName); CDuiString szUserData = pNowNode->GetUserData() + _T("\\") + pNode->GetItemText(); pNode->SetUserData(szUserData); } } else { CListTextElementUI* pLine = new CListTextElementUI; pList->Add(pLine); CDuiString szNewName(FindFileData.cFileName); int pos = szNewName.ReverseFind('.'); CDuiString szExt = szNewName.Right(szNewName.GetLength() - pos); SHFILEINFO shfi; memset(&shfi,0,sizeof(shfi)); SHGetFileInfo(szExt, FILE_ATTRIBUTE_NORMAL, &shfi, sizeof(shfi), SHGFI_ICON|SHGFI_USEFILEATTRIBUTES); pLine->SetIcon(0,shfi.hIcon); pLine->SetText(0,szNewName); SYSTEMTIME st; FileTimeToSystemTime(&FindFileData.ftLastWriteTime,&st); CDuiString szTime; szTime.Format(_T("%04d/%02d/%02d %02d:%02d:%02d"), st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond); pLine->SetText(1,szTime); DWORDLONG dwlSize = (DWORDLONG)(FindFileData.nFileSizeHigh * (MAXDWORD+1)) + FindFileData.nFileSizeLow; CDuiString szSize; if (dwlSize <1024) { szSize.Format(_T("%ldB"),dwlSize); } else { szSize.Format(_T("%ldK"),dwlSize/1024); } pLine->SetText(2,szSize); CDuiString szArrtib; szArrtib.Format(_T("%d"),FindFileData.dwFileAttributes); pLine->SetText(3,szArrtib); } } while(FindNextFile(hListFile, &FindFileData)); } } }
void CRegistersPageWnd::OnPrepareAnimation() { CListUI* pList = static_cast<CListUI*>(m_pm.FindControl(_T("list"))); pList->SetTextCallback(this); // We want GetItemText for items for( int i = 0; i < 1000; i++ ) pList->Add(new CListTextElementUI); // We want 1000 items in list }
void CSystemsPageWnd::OnPrepareAnimation() { CListUI* pList = static_cast<CListUI*>(m_pm.FindControl(_T("list"))); pList->SetTextCallback(this); // List will call our GetItemText() }
void CMainDialog::OnNotify( TNotifyUI& msg ) { if (msg.sType == _T ("itemactivate")) { if (_tcsicmp (msg.pSender->GetClass(), _T("ListUI")) == 0) { CListUI* pList = static_cast <CListUI*> (m_pm.FindControl(_T ("lstNormal"))); ASSERT(pList); if (pList) { CDuiString str; str.Format(_T ("双击或回车了 %d 项"), pList->GetCurSel()); MessageBox (GetHWND(), str, NULL, MB_OK); } } else if (msg.pSender && msg.pSender->GetParent () && msg.pSender->GetParent ()->GetParent () && _tcsicmp (msg.pSender->GetParent ()->GetParent ()->GetClass(), _T("Tree")) == 0) { CDuiTreeView* pTree1 = static_cast<CDuiTreeView*>(m_pm.FindControl(_T("Tree1"))); if( pTree1 != NULL && pTree1->GetItemIndex(msg.pSender) != -1 ) { if( _tcscmp(msg.pSender->GetClass(), _T("ListLabelElementUI")) == 0 ) { CDuiTreeView::Node* node = (CDuiTreeView::Node*)msg.pSender->GetTag(); pTree1->SetChildVisible(node, !node->data()._child_visible); } } } } if( msg.sType == _T("itemclick") ) { if (msg.pSender && msg.pSender->GetParent () && msg.pSender->GetParent ()->GetParent () && _tcsicmp (msg.pSender->GetParent ()->GetParent ()->GetClass(), _T("Tree")) == 0) { CDuiTreeView* pTree1 = static_cast<CDuiTreeView*>(m_pm.FindControl(_T("Tree1"))); if( pTree1 && pTree1->GetItemIndex(msg.pSender) != -1 ) { if( _tcscmp(msg.pSender->GetClass(), _T("ListLabelElementUI")) == 0 ) { CDuiTreeView::Node* node = (CDuiTreeView::Node*)msg.pSender->GetTag(); POINT pt = { 0 }; ::GetCursorPos(&pt); ::ScreenToClient(m_pm.GetPaintWindow(), &pt); pt.x -= msg.pSender->GetX(); SIZE sz = pTree1->GetExpanderSizeX(node); if( pt.x >= sz.cx && pt.x < sz.cy ) pTree1->SetChildVisible(node, !node->data()._child_visible); } } } } if (_tcscmp(msg.pSender->GetClass(), _T("ListHeaderItemUI")) == 0 && msg.sType == _T ("headerclick")) { CListUI* pList = static_cast <CListUI*> (m_pm.FindControl(_T ("lstNormal"))); ASSERT(pList); if (pList) { CListHeaderUI* pHeader = pList->GetHeader(); ASSERT(pHeader); if (pHeader) { for (int i = 0; i < pHeader->GetCount(); ++i) { CControlUI* pItem = pHeader->GetItemAt (i); ASSERT(pItem); if (pItem) { if (PtInRect (&pItem->GetPos(), msg.ptMouse)) { CDuiString str; str.Format(_T ("单击了头 %d 项"), i); MessageBox (GetHWND(), str, NULL, MB_OK); } } } } } } CDuiDialog::OnNotify(msg); }
void CLoginDlg::OnPrepare(TNotifyUI& msg) { __super::OnPrepare(msg); CControlUI* pControl = m_PaintManager.FindControl("maxbtn"); if(pControl) pControl->SetVisible(false); CCheckBoxUI* pCheckBox = (CCheckBoxUI*)m_PaintManager.FindControl("autologin"); //pCheckBox->SetCheck(true); static CMyBrowserEventHandler eventhandle; CWebBrowserUI* m_pbrowserSpList = static_cast<CWebBrowserUI*>(m_PaintManager.FindControl(_T("ie"))); if (m_pbrowserSpList) { m_pbrowserSpList->SetWebBrowserEventHandler(&eventhandle); m_pbrowserSpList->Navigate2("about:blank"); PostMessage(WM_MSG_SET_FOCUS); // m_pbrowserSpList->Navigate2("http://www.baidu.com"); } CWebBrowserUI* m_pbrowserSpList1 = static_cast<CWebBrowserUI*>(m_PaintManager.FindControl(_T("ie2"))); if (m_pbrowserSpList1) { m_pbrowserSpList1->SetWebBrowserEventHandler(&eventhandle); m_pbrowserSpList1->Navigate2("http://www.baidu.com"); } CListUI *list = static_cast<CListUI*>(m_PaintManager.FindControl(_T("listex"))); list->SetKeyboardEnabled(false); //³õʼ»¯Ê÷µÄÏÔʾ CTreeViewUI* pTree = static_cast<CTreeViewUI*>(m_PaintManager.FindControl(_T("tree"))); if (!pTree) { return; } pControl = m_PaintManager.FindControl(_T("drag")); pTree->m_pDragingCtrl = pControl; CTreeNodeUI* pNodeRoot = new CTreeNodeUI; pNodeRoot->SetAttribute(_T("folderattr"),_T("padding=\"0,1,0,0\" width=\"36\" height=\"16\" normalimage=\"file='treeview_b.png' source='0,0,36,16'\" hotimage=\"file='treeview_b.png' source='36,0,72,16'\" selectedimage=\"file='treeview_a.png' source='0,0,36,16' selectedhotimage=\"file='treeview_a.png' source='36,0,72,16'\"")); pTree->Add(pNodeRoot); CDuiString strNode = ""; strNode.Format("Ö÷»úÁбí"); pNodeRoot->SetItemText(strNode); pNodeRoot->SetExpand(true); //m_pNodeRoot = pNodeRoot; for (int i = 1; i < 17; i++) { int nn = pNodeRoot->GetCountChild(); CTreeNodeUI* pNodeParent = new CTreeNodeUI; pNodeRoot->AddChildNode(pNodeParent); pNodeParent->SetName(strNode); pNodeParent->SetAttribute(_T("folderattr"),_T("padding=\"0,1,0,0\" width=\"36\" height=\"16\" normalimage=\"file='treeview_b.png' source='0,0,36,16'\" hotimage=\"file='treeview_b.png' source='36,0,72,16'\" selectedimage=\"file='treeview_a.png' source='0,0,36,16' selectedhotimage=\"file='treeview_a.png' source='36,0,72,16'\"")); CDuiString strNode = ""; strNode.Format("Ŀ¼%d", i); pNodeParent->SetItemText(strNode); pNodeParent->SetName(strNode); if (i % 4 == 0) { pNodeParent->SetExpand(true); } for (int j = 1; j< 7; j++) { CTreeNodeUI* pNodeChild = new CTreeNodeUI(true); //±íʾÊÇÒ¶×Ó½Úµã CDuiString strNode = ""; strNode.Format("%d_%d", i, j); pNodeChild->SetItemText(strNode); pNodeChild->SetName(strNode); pNodeParent->AddChildNode(pNodeChild); } } }
void CRightFrame::Init() { CLoveSendClassInExe* pGameFrame = static_cast<CLoveSendClassInExe*>(m_pRoom); CString sPath = CBcfFile::GetAppPath(); //获取窗口的最大宽度与最小宽度 CBcfFile fGSkin(sPath + "GameOption.bcf"); m_uMaxWidth = fGSkin.GetKeyVal(_T("RightFrame"),"max_width",324); m_uMinWidth = fGSkin.GetKeyVal(_T("RightFrame"),"min_width",248); m_uOldWidth = fGSkin.GetKeyVal("RightFrame","old_width",0); //是否能隐藏该窗口 m_bCanHide = fGSkin.GetKeyVal(_T("RightFrame"),"can_hide",1); //判断是否百家乐游戏 TCHAR szKey[10]; CBcfFile fsr(sPath + "..\\SpecialRule.bcf"); wsprintf(szKey, "%d", pGameFrame->m_pGameInfo->uNameID); m_bBJLGame = (fsr.GetKeyVal(_T("BJLType"),szKey,0) == 1); //玩家是否用踢人道具 CBcfFile fOr(sPath + "..\\Order.bcf"); m_bUseKickUserProp = (fOr.GetKeyVal(_T("ClassInExe"),_T("UseKickUserProp"),0) == 1); //如果是百人游戏,显示与隐藏窗口按钮无效 CButtonUI* pBtnCtrl = static_cast<CButtonUI*>(m_pm.FindControl("Btn_Show_Wnd")); if (pBtnCtrl) { pBtnCtrl->SetEnabled(m_bCanHide && (!m_bBJLGame)); } //用户列表指针 CListUI* pListCtrl = static_cast<CListUI*>(m_pm.FindControl("Lst_List_Users")); pListCtrl->SetTextCallback(this); pListCtrl->SetContextMenuUsed(true); m_pUsersList = new CGameUserListCtrlDu(pListCtrl); //加载常用控件的样式 LoadNormalCtrlSkin(); //初始化道具栏 InitProp(); CFont f; f.CreateFont( 12, // nHeight 0, // nWidth 0, // nEscapement 0, // nOrientation FW_NORMAL, // nWeight FALSE, // bItalic FALSE, // bUnderline下划线标记,需要下划线把这里设置成TRUE 0, // cStrikeOut ANSI_CHARSET, // nCharSet OUT_DEFAULT_PRECIS, // nOutPrecision CLIP_DEFAULT_PRECIS, // nClipPrecision DEFAULT_QUALITY, // nQuality DEFAULT_PITCH | FF_SWISS, // nPitchAndFamily _T("宋体")); // lpszFacename //聊天框 m_pTalkBoxList = static_cast<CListUI*>(m_pm.FindControl("Talk_Lst_Main")); //开聊天框缓冲文本 m_pTalkTempText = static_cast<CTextUI*>(m_pm.FindControl("Talk_Text_Temp")); OnReLoadTalkINI(); }
void Notify(TNotifyUI& msg) { if( msg.sType == _T("windowinit") ) OnPrepare(msg); else if( msg.sType == _T("click") ) { if( msg.pSender == m_pCloseBtn ) { PostQuitMessage(0); return; } else if( msg.pSender == m_pMinBtn ) { SendMessage(WM_SYSCOMMAND, SC_MINIMIZE, 0); return; } else if( msg.pSender == m_pMaxBtn ) { SendMessage(WM_SYSCOMMAND, SC_MAXIMIZE, 0); return; } else if( msg.pSender == m_pRestoreBtn ) { SendMessage(WM_SYSCOMMAND, SC_RESTORE, 0); return; } else if(msg.pSender == m_pSearch) { OnSearch(); } } else if(msg.sType==_T("setfocus")) { } else if( msg.sType == _T("itemclick") ) { } else if( msg.sType == _T("itemactivate") ) { int iIndex = msg.pSender->GetTag(); CStdString sMessage = _T("Click: ");; #ifdef _UNICODE int iLen = domain[iIndex].length(); LPWSTR lpText = new WCHAR[iLen + 1]; ::ZeroMemory(lpText, (iLen + 1) * sizeof(WCHAR)); ::MultiByteToWideChar(CP_ACP, 0, domain[iIndex].c_str(), -1, (LPWSTR)lpText, iLen) ; sMessage += lpText; delete[] lpText; #else sMessage += domain[iIndex].c_str(); #endif ::MessageBox(NULL, sMessage.GetData(), _T("提示(by tojen)"), MB_OK); } else if(msg.sType == _T("menu")) { if( msg.pSender->GetName() != _T("domainlist") ) return; CMenuWnd* pMenu = new CMenuWnd(); if( pMenu == NULL ) { return; } POINT pt = {msg.ptMouse.x, msg.ptMouse.y}; ::ClientToScreen(*this, &pt); pMenu->Init(msg.pSender, pt); } else if( msg.sType == _T("menu_Delete") ) { CListUI* pList = static_cast<CListUI*>(msg.pSender); int nSel = pList->GetCurSel(); if( nSel < 0 ) return; pList->RemoveAt(nSel); domain.erase(domain.begin() + nSel); desc.erase(desc.begin() + nSel); } }