📄 portscandlg.h
字号:
// PortScanDlg.h : header file
//
#if !defined(AFX_PORTSCANDLG_H__63DE909E_EC24_4304_A486_A12C6056BC98__INCLUDED_)
#define AFX_PORTSCANDLG_H__63DE909E_EC24_4304_A486_A12C6056BC98__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
/////////////////////////////////////////////////////////////////////////////
// CPortScanDlg dialog
#include <afxsock.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <io.h>
typedef struct
{
int nAttempts;
TCHAR IPAddress[16];
TCHAR port[5];
BOOL bStatus;
}DATA;
class CPortScanDlg : public CDialog
{
// Construction
public:
CPortScanDlg(CWnd* pParent = NULL); // standard constructor
~CPortScanDlg();
// Dialog Data
//{{AFX_DATA(CPortScanDlg)
enum { IDD = IDD_PORTSCAN_DIALOG };
CEdit m_cSinglePort;
CEdit m_cPortTo;
CEdit m_cPortFrom;
CEdit m_cAttempts;
CButton m_cBtnStop;
CButton m_cBtnScan;
CProgressCtrl m_cProgress;
CListCtrl m_cResult;
CIPAddressCtrl m_cIP;
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CPortScanDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
protected:
BOOL TestConnection(CString IP,UINT nPort);
void ShowHeaders(void); //show listctrl 's headers
void AddHeader(LPTSTR hdr); //add listctrl 's headers
BOOL AddItem(int nItem,int nSubItem,LPCTSTR strItem,
int nImageIndex = -1);
BOOL AddColumn(LPCTSTR strItem,int nItem,int nSubItem = -1,
int nMask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM,
int nFmt = LVCFMT_LEFT);
UINT m_nMaxAttempts;
BOOL m_bSinglePort;
UINT m_minPort,m_maxPort;
UINT m_nCounter;
CStringList* m_pColumns;
CPtrList* m_pStatusList;
// Implementation
protected:
HICON m_hIcon;
// Generated message map functions
//{{AFX_MSG(CPortScanDlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnRadioSingle();
afx_msg void OnRadioRange();
afx_msg void OnButtonScan();
afx_msg void OnButtonStop();
afx_msg void OnButtonSave();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_PORTSCANDLG_H__63DE909E_EC24_4304_A486_A12C6056BC98__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -