int DlgGuardFlags::GetFlags() { CListBox *lb; int new_flags = 0; lb = (CListBox*)GetDlgItem(IDC_GUARD_FLAGS); for(int i = 0; i < GuardBitCount(); i++) { if(lb->GetSel(i)) SET_BIT(new_flags, lb->GetItemData(i)); else REMOVE_BIT(new_flags, lb->GetItemData(i)); } return new_flags; }
void CConnDlg :: OnKillSocket() { CWysApp* pApp = (CWysApp*)AfxGetApp(); INT iItem; CString szTemp; SCREENLINE sl; // get the current selection CWysWnd* pWnd = (CWysWnd*)pApp->m_pMainWnd; CListBox* pListBox = (CListBox*)GetDlgItem(IDC_LSTCONN); iItem = pListBox->GetCurSel(); if (iItem == LB_ERR) { szTemp.LoadString(IDS_NOSEL); this->MessageBox(szTemp, NULL, MB_ICONINFORMATION); return; } // get the socket value // for currently selected item SOCKET hSocket; hSocket = (SOCKET)pListBox->GetItemData(iItem); if (hSocket == LB_ERR) { szTemp.LoadString(IDS_SOCKERRLST); this->MessageBox(szTemp, NULL, MB_ICONINFORMATION); return; } szTemp.LoadString(IDS_KILLSOCK); if (this->MessageBox(szTemp, "Kill Connection", MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON2) == IDYES) { CWySock* pSock = (CWySock*)CAsyncSocket::FromHandle(hSocket); if (!pSock) { szTemp.LoadString(IDS_ERRNOSOCK); this->MessageBox(szTemp, NULL, MB_ICONINFORMATION); return; } // add item to screen list sl.uColor = COLOR_RED; szTemp.LoadString(IDS_SERVKILL); sl.szText.Format(szTemp, pSock->IPAddress); pWnd->AddListItem(&sl); // remove socket from array of connected sockets pSock->Close(); pSock->m_hSocket = INVALID_SOCKET; pSock->State = FREE; // refresh list OnRefresh(); } return; }
void CLabelTypeDialog::OnOK() { CListBox* pList; if ((pList = (CListBox*)GetDlgItem(IDC_LABEL_LIST)) != NULL) { int nCurSel = pList->GetCurSel(); if (nCurSel != -1) { m_pChosenLabel = (CLabelData*)pList->GetItemData(nCurSel); } } CPmwDialogColor::OnOK(); }
void CEnvelopeTypeDialog::OnOK() { CListBox* pList; if ((pList = (CListBox*)GetDlgItem(IDC_ENVELOPE_LIST)) != NULL) { int nCurSel = pList->GetCurSel(); if (nCurSel != -1) { m_pChosenInfo = (CLabelData*)pList->GetItemData(nCurSel); } } CPmwDialogColor::OnOK(); }
void CLabelTypeDialog::OnSelchangeLabelList() { CLabelData* pLabelData = NULL; CListBox* pList; if ((pList = (CListBox*)GetDlgItem(IDC_LABEL_LIST)) != NULL) { int nCurSel = pList->GetCurSel(); if (nCurSel != -1) { pLabelData = (CLabelData*)pList->GetItemData(nCurSel); } } m_pPreview->SetLabel(pLabelData); }
void CEnvelopeTypeDialog::OnSelchangeEnvelopeList() { m_pChosenInfo = NULL; CListBox* pList; if ((pList = (CListBox*)GetDlgItem(IDC_ENVELOPE_LIST)) != NULL) { int nCurSel = pList->GetCurSel(); if (nCurSel != -1) { m_pChosenInfo = (CLabelData*)pList->GetItemData(nCurSel); } } UpdatePreview(); }
//************************************************************************** void OPCServerDlg::OnSelchangeServerList() { CWaitCursor wait; UpdateData(); CListBox* pList = (CListBox*)GetDlgItem( IDC_SERVER_LIST ); int index = pList->GetCurSel(); OPCServerInfo* pServerInfo = (OPCServerInfo*)pList->GetItemData(index); if( pServerInfo && (DWORD)pServerInfo != LB_ERR ) { m_clsid = pServerInfo->m_clsid; m_Server = pServerInfo->m_ProgID; } UpdateData( FALSE ); }
void CPhotoProjectsTypeDlg::OnSelchangePhotoProjectsList() { CListBox* pList; if ((pList = (CListBox*)GetDlgItem(IDC_PHOTOPROJECTS_LIST)) != NULL) { int nCurSel = pList->GetCurSel(); if (nCurSel != -1) { m_pChosenPhotoProject = (CPhotoPrjData*)pList->GetItemData(nCurSel); } } UpdatePreview(); }
void CPhotoProjectsTypeDlg::OnOK() { CListBox* pList; if ((pList = (CListBox*)GetDlgItem(IDC_PHOTOPROJECTS_LIST)) != NULL) { int nCurSel = pList->GetCurSel(); if (nCurSel != -1) { m_pChosenPhotoProject = (CPhotoPrjData*)pList->GetItemData(nCurSel); int nType = nCurSel; m_PhotoProjectType = (PHOTO_PROJECT_TYPE)nType; } } CPmwDialogColor::OnOK(); }