// TraceView.h : interface of the CTraceView class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_TRACEVIEW_H__8BDE71AC_FFB0_404E_B7C6_4BFF81D85D3D__INCLUDED_)
#define AFX_TRACEVIEW_H__8BDE71AC_FFB0_404E_B7C6_4BFF81D85D3D__INCLUDED_

#include "BatGoRang.h"	// Added by ClassView
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "mytab.h"
#include "outbarctrl.h"
/////////////////////////////////////////////////////////////////////////////
// CTraceView window
#define MAX_TAB 5

class CTraceView : public CWnd
{
// Construction
public:
	CTraceView();

// Attributes
public:

// Operations
public:
    BATGORANGDATA m_prevdata;
	
// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CTraceView)
	public:
	protected:
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	//}}AFX_VIRTUAL

// Implementation
public:
	COutBarCtrl m_OutBarCtrl;/* 2K5 216 KR **/

	CPtrArray m_arData;
	void NETraceLog(LPSTR szbuff);
	BOOL m_FirstCreated;
	void OutPutProgramInfo();
	void AddTraceData(LPBATGORANGDATA lpData);
	BATGORANGDATA m_TraceData;
	int GetSharedMemoryNeTraceDataFromExternalProcess(LPBATGORANGDATA lpData);
	void SetSharedMemoryNeTraceDataFromExternalProcess(LPBATGORANGDATA lpData);
	int GetSharedMemoryNeTraceData(LPBATGORANGDATA lpData);
	void SetSharedMemoryNeTraceData(LPBATGORANGDATA lpData);
	LPVOID m_lpvSharedMemory;
	HANDLE m_hMapObjectSharedMemory;
	int DestroySharedMemory();
	int CreateSharedMemory();
	char m_szLine[500];
    int GatheringData();
	int ParseCmd();
    int m_gatheron;
    int AddLineString(LPCSTR szLineString, int iTabItem);
	BOOL m_IsActive;
	CEdit * m_pLogEdit[MAX_TAB];
	int m_linecount[MAX_TAB];
	CStatic m_staticTitle;
	CMyTab m_wndTab;
	CListBox m_List;
	BOOL RegisterWindowClass();
	virtual ~CTraceView();
	CFont       m_fontBig;
	CFont       m_fontNorm;
	CFont       m_fontSmall;
	CFont       m_fontLogEdit;
	CFont       m_fontSendEdit;
    void ActivateApp(BOOL bActive, DWORD hTask);
	BOOL CloseNow();
protected:
    CEdit *m_prevEdit;
    COLORREF m_crOutBack[MAX_TAB];
    COLORREF m_crLogBack[MAX_TAB];
    COLORREF m_crLogText[MAX_TAB];
    HBRUSH   m_hrLogBrush[MAX_TAB];

	// Generated message map functions
protected:
	//{{AFX_MSG(CTraceView)
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
	afx_msg void OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized);
	afx_msg void OnPaint();
	afx_msg void OnDestroy();
	afx_msg void OnViewsharedmemory();
	afx_msg void OnProgramis();
	afx_msg void OnClearscreen();
	afx_msg void OnCreatesharedmemory();
	afx_msg void OnFreesharedmemory();
	afx_msg void OnTimer(UINT nIDEvent);
	//}}AFX_MSG
	afx_msg LONG OnNeTraceWindowCommand(WPARAM wParam, LPARAM lParam);
	afx_msg LONG OnTestFunc(WPARAM wParam, LPARAM lParam);
    afx_msg void OnTabCommand(UINT nCommand);
	DECLARE_MESSAGE_MAP()
public:
    afx_msg void OnSaveFileAll();
};

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

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

#endif // !defined(AFX_TRACEVIEW_H__8BDE71AC_FFB0_404E_B7C6_4BFF81D85D3D__INCLUDED_)
