return true;    }   }  } 
 return false; } 
 
  在表格的某一格处于焦点时,我们应给其画一个矩形边框: 
int XTable::Draw(CDC* pDC) {  //…  if (focusRow < rows && focusCol < cols) //**  {   RECT rect = GetRect (focusRow, focusCol);   GetCells (focusRow, focusCol)->DrawHitBorder(pDC, rect, RGB(0xb0, 0xb0, 0xb0));  } 
 return 0; } 
int XCell::DrawHitBorder (CDC* pDC, RECT rect, COLORREF color) {  CPen pen (PS_SOLID, 2, color);  CPen* oldPen = pDC->SelectObject(&pen);  pDC->MoveTo (rect.left, rect.top);  pDC->LineTo (rect.right, rect.top);  pDC->LineTo (rect.right, rect.bottom);  pDC->LineTo (rect.left, rect.bottom);  pDC->LineTo (rect.left, rect.top);  pDC->SelectObject(oldPen);  return 0; } 
 
  获得IP地址监控范围内主机列表的方法如下: 
m_fromip.GetAddress(fromip); m_toip.GetAddress(toip); 
rthread = CreateThread(NULL, 0, sniff, 0, 0, 0); Sleep(100); //保证sniff线程已经稳定运行 SendArpReq(1, myip, mmac); while (1) {  if (!(!mmac[0] && !mmac[1] && !mmac[2] && !mmac[3]))   break;  Sleep(100); } 
for (unsigned long i = fromip; i < myip; i++) {  SendArpReq(myip, i, mmac); } 
for (i = myip + 1; i <= toip; i++) {  SendArpReq(myip, i, mmac); } 
Sleep(1000); 
for (i = 0; i < currentHstIndex; i++) {  HOSTENT *tmpHostent;  tmpHostent = gethostbyaddr((char*)(&(hostList[i].ip)), 16, AF_INET);  if (tmpHostent)   m_hostList.SetText(i + 1, 0, tmpHostent->h_name);  m_hostList.SetText(i + 1, 1, inet_ntoa(*(struct in_addr*)(&(hostList[i].ip)))) ;  m_hostList.SetText(i + 1, 3, "OFF");  CString str;  str.Format("%02x-%02x-%02x-%02x-%02x-%02x", hostList[i].mac[0],   hostList[i].mac[1], hostList[i].mac[2], hostList[i].mac[3],   hostList[i].mac[4], hostList[i].mac[5]);  m_hostList.SetText(i + 1, 2, str);  m_hostList.SetText(i + 1, 4, "OFF"); 
 
		      
		      
		      
		      
		      
		      
                       
		      
		        
		      共15页: 上一页 [1] [2] [3] [4] 5 [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] 下一页 
		     |