www.pudn.com > NetScan.rar > SoftDlg.cpp
// SoftDlg.cpp : implementation file
//
#include "stdafx.h"
#include "NetScan.h"
#include "SoftDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CSoftDlg dialog
CSoftDlg::CSoftDlg(CWnd* pParent /*=NULL*/)
: CDialog(CSoftDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CSoftDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CSoftDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CSoftDlg)
DDX_Control(pDX, IDC_LIST1, m_softList);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CSoftDlg, CDialog)
//{{AFX_MSG_MAP(CSoftDlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CSoftDlg message handlers
BOOL CSoftDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
addList();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CSoftDlg::addList()
{
LV_ITEM lvitem;
LV_COLUMN lvcol;
int i;//iPos,iItemNum;
lvcol.mask=LVCF_FMT|LVCF_SUBITEM|LVCF_TEXT|LVCF_WIDTH;
lvcol.fmt=LVCFMT_LEFT;
i=0;
lvcol.pszText="Index";
lvcol.iSubItem=i;
lvcol.cx=100;
m_softList.InsertColumn(i++,&lvcol);
lvcol.pszText="Name";
lvcol.iSubItem=i;
lvcol.cx=100;
m_softList.InsertColumn(i++,&lvcol);
lvcol.pszText="Type";
lvcol.iSubItem=i;
lvcol.cx=100;
m_softList.InsertColumn(i++,&lvcol);
/* lvcol.pszText="Proto";
lvcol.iSubItem=i;
lvcol.cx=100;
m_ProcessList.InsertColumn(i++,&lvcol);
lvcol.pszText="Mask";
lvcol.iSubItem=i;
lvcol.cx=100;
m_ProcessList.InsertColumn(i++,&lvcol);*/
for(i=0;i<(m_softIndexCount-1);i++)
{
lvitem.mask=LVIF_TEXT|LVIF_IMAGE|LVIF_PARAM;
lvitem.iItem=i;
lvitem.iSubItem=0;
lvitem.pszText=m_SoftIndex[i];
m_softList.InsertItem(&lvitem);
lvitem.mask=LVIF_TEXT;
//lvitem.iItem=iPos;
lvitem.iSubItem=1;
lvitem.pszText=m_SoftName[i];
m_softList.SetItem(&lvitem);
lvitem.iSubItem=2;
lvitem.pszText=m_SoftType[i];
m_softList.SetItem(&lvitem);
/* lvitem.iSubItem=3;
lvitem.pszText=m_routeProto[i];
m_routeList.SetItem(&lvitem);
lvitem.iSubItem=4;
lvitem.pszText=m_routeMask[i];
m_routeList.SetItem(&lvitem);*/
}
}