📄 mainfrm.h
字号:
///////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright 1999 - 2000 Mark Roddy
// All Rights Reserved
//
// Hollis Technology Solutions
// 94 Dow Road
// Hollis, NH 03049
// info@hollistech.com
//
// Synopsis:
//
//
// Version Information:
//
// $Header: /iphook/usr/IpMonitor/MainFrm.h 3 1/27/00 10:35p Markr $
//
///////////////////////////////////////////////////////////////////////////////
// MainFrm.h : interface of the CMainFrame class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_MAINFRM_H__1EF6FF8A_FC46_4D64_ADC4_7459A87E1902__INCLUDED_)
#define AFX_MAINFRM_H__1EF6FF8A_FC46_4D64_ADC4_7459A87E1902__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define BUFFER_AVAILABLE_MSG (WM_USER + 1)
typedef struct {
UINT numBufs;
HWND mainwindow;
BOOL * pStarted;
} WIN_CONTEXT;
class IoContext {
private:
OVERLAPPED overlapped;
HANDLE event;
UINT nbuffers;
UCHAR *rawBuffer;
IPHOOK_BUFFER * buffer;
public:
IoContext(UINT nbuffers);
~IoContext();
PVOID IoBuffer() {
return (PVOID) buffer;
}
DWORD IoSize() {
return sizeof(IPHOOK_BUFFER) + (sizeof(IPHOOK_DATA) * (nbuffers -1));
}
void deleteBuffer() {
delete[] rawBuffer;
rawBuffer = NULL;
buffer = NULL;
}
void releaseBuffer() {
rawBuffer = NULL;
}
OVERLAPPED * over() { return &overlapped; }
bool init(); // prepare for IO
};
class CMainFrame : public CFrameWnd
{
protected: // create from serialization only
CMainFrame();
DECLARE_DYNCREATE(CMainFrame)
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMainFrame)
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
virtual LRESULT OnBufferMessage(WPARAM wParam, LPARAM lParam);
//}}AFX_VIRTUAL
// Implementation
public:
BOOLEAN startSomeBuffers(UINT numBufs);
virtual ~CMainFrame();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected: // control bar embedded members
CStatusBar m_wndStatusBar;
// Generated message map functions
protected:
//{{AFX_MSG(CMainFrame)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnStartHook();
afx_msg void OnStopHook();
afx_msg void OnUpdateStartHook(CCmdUI* pCmdUI);
afx_msg void OnUpdateStopHook(CCmdUI* pCmdUI);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
DWORD workerId;
HANDLE workerHandle;
BOOL m_Started;
BOOL m_Enabled;
WIN_CONTEXT m_context;
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MAINFRM_H__1EF6FF8A_FC46_4D64_ADC4_7459A87E1902__INCLUDED_)
///////////////////////////////////////////////////////////////////////////////
//
// Change History Log
//
// $Log: /iphook/usr/IpMonitor/MainFrm.h $
//
// 3 1/27/00 10:35p Markr
// Prepare to release!
//
///////////////////////////////////////////////////////////////////////////////
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -