selectdlg.cpp
来自「This article describes a sniffer for Win」· C++ 代码 · 共 91 行
CPP
91 行
//////////////////////////////////////////////////////////////////////////////
//
// WinSniff 1.1
// The sniffing tool for windows.
//
// Author : Nagareshwar Y Talekar.
// Contact : nsry2002@yahoo.co.in
// Date : 15-6-2004.
//
// Name : SelectDlg.cpp
// Description : Displays a dialog box for selecting device
// for capturing packet.
//
//////////////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "capturepacket.h"
#include "SelectDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// SelectDlg dialog
SelectDlg::SelectDlg(Sniffer *s)
: CDialog(SelectDlg::IDD, NULL)
{
// Pointer to Sniffer class
sniff=s;
//{{AFX_DATA_INIT(SelectDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void SelectDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(SelectDlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(SelectDlg, CDialog)
//{{AFX_MSG_MAP(SelectDlg)
ON_BN_CLICKED(IDOK, OnSelect)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
BOOL SelectDlg::OnInitDialog()
{
CDialog::OnInitDialog();
devlist=(CComboBox*)GetDlgItem(IDC_COMBO1);
devlist->SetWindowPos(&wndTop,0,0,250,120,SWP_SHOWWINDOW | SWP_NOMOVE);
for(int i=0;i<sniff->devcount;i++)
{
devlist->AddString(sniff->description[i]);
}
devlist->SetCurSel(0);
return TRUE;
}
void SelectDlg::OnSelect()
{
selindex=devlist->GetCurSel();
CDialog::OnOK();
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?