// MainFrm.h : interface of the CMainFrame class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_MAINFRM_H__515B732A_1CF5_11D4_AB58_00400553A81B__INCLUDED_)
#define AFX_MAINFRM_H__515B732A_1CF5_11D4_AB58_00400553A81B__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000


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)
	public:
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	protected:
//	virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
	//}}AFX_VIRTUAL

// Implementation
public:
	BOOL m_firstTime;

	virtual ~CMainFrame();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

public:  // control bar embedded members
	CStatusBar  m_wndStatusBar;
	CToolBar    m_wndToolBar;
	CReBar      m_wndReBar;
	CDialogBar  m_wndDlgBar;

// Generated message map functions
protected:
	//{{AFX_MSG(CMainFrame)
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnDestroy();
	afx_msg void OnUpdateInsert(CCmdUI* pCmdUI);
	afx_msg void OnToggleInsert();
	afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
	afx_msg void OnClose();
	afx_msg void OnKillrestart();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};


/*---------------------------------*/
/* Global Variables                */
/*---------------------------------*/

#define KBD_BUFFER_SIZE            1024


#ifdef MAINFRM_FILE

       int              kbd_buff[KBD_BUFFER_SIZE];
       int              kbd_begin=0;
       int              kbd_end=0;

       CRITICAL_SECTION cs;
       HANDLE           kbd_event;

       HANDLE           thread_event;
       CWinThread*      theThread;

#else

extern int              kbd_buff[];
extern int              kbd_begin;
extern int              kbd_end;

extern CRITICAL_SECTION cs;
extern HANDLE           kbd_event;

extern HANDLE           thread_event;
extern CWinThread*      theThread;

#endif




/*---------------------------------*/
/* Function Prototypes             */
/*---------------------------------*/

#define Inc_Buff_Index(i)   ((i)=((i)+1) % KBD_BUFFER_SIZE)

#define ToKbdBuff(x)        {kbd_buff[kbd_end]=x; Inc_Buff_Index(kbd_end);}




/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_MAINFRM_H__515B732A_1CF5_11D4_AB58_00400553A81B__INCLUDED_)
