// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
// TODO: Add extra initialization here
int i=0;
//…
m_hostList.Create(CRect(12,115,435,466),this, 1000,WS_BORDER |WS_VISIBLE |WS_VSCROLL|WS_CHILD);
m_hostList.SetScrollRange(1,0,351);
m_hostList.EnableScrollBar(ESB_ENABLE_BOTH);
m_hostList.SetCols (5);
m_hostList.SetRows (256);
for (i = 0; i < 256; i ++)
{
m_hostList.SetRowHeight (i, 13);
for(int j =0;j<5;j++)
{
m_hostList.SetAlignment(i,j,DT_CENTER);
}
}
m_hostList.SetColWidth (0, 100);
m_hostList.SetColWidth (1, 130);
m_hostList.SetColWidth (2, 50);
m_hostList.SetColWidth (3, 55);
m_hostList.SetColWidth (4, 70);
m_hostList.SetText (0,0,"IP地址");
m_hostList.SetText (0,1,"MAC地址");
m_hostList.SetText (0,2,"Sniffer");
m_hostList.SetText (0,3,"ARP欺骗");
m_hostList.SetText (0,4,"报告IP冲突");
m_packetList.Create(CRect(444,26,768,466),this, 1000);
m_packetList.SetCols (6);
m_packetList.SetRows (31);
for (i = 0; i < 30; i ++)
{
m_packetList.SetRowHeight (i, 13);
for(int j =0;j<6;j++)
{
m_packetList.SetAlignment(i,j,DT_CENTER);
}
}
m_packetList.SetRowHeight (i, 47);
m_packetList.SetColWidth (0, 75);
m_packetList.SetColWidth (1, 75);
m_packetList.SetColWidth (2, 32);
m_packetList.SetColWidth (3, 45);
m_packetList.SetColWidth (4, 55);
m_packetList.SetColWidth (5, 40);
m_packetList.SetText (0,0,"源IP");
m_packetList.SetText (0,1,"目的IP");
m_packetList.SetText (0,2,"协议");
m_packetList.SetText (0,3,"源端口");
m_packetList.SetText (0,4,"目的端口");
m_packetList.SetText (0,5,"长度");
m_packetList.JoinCells (30,0,30,5);
mailDlg = this;
return TRUE; // return TRUE unless you set the focus to a control
}