
#pragma once
#if !defined(AFX_CONSOLEBOX_H__3D22F593_4E2E_49EC_8C5E_53257F0F5874__INCLUDED_)
#define AFX_CONSOLEBOX_H__3D22F593_4E2E_49EC_8C5E_53257F0F5874__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ConsoleBox.h
//

#include <afxtempl.h>
/////////////////////////////////////////////////////////////////////////////
// CConsoleBox

class CConsoleBox : public CEdit
{
		DECLARE_DYNAMIC(CConsoleBox)

	public:
		CConsoleBox();

	public:
		void CarryReturn(BOOL bLineFeed = TRUE);
		int PrintF(LPCTSTR fmt, ...);
		void PutChar(TCHAR ch);

		// {{AFX_VIRTUAL(CConsoleBox)
	protected:
		virtual BOOL PreCreateWindow(CREATESTRUCT &cs) override;
		virtual LRESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam);
		// }}AFX_VIRTUAL

	public:
		virtual ~CConsoleBox() override;

	protected:
		void AppendText(LPCTSTR lpszText = nullptr);
		void SetCaretPos(int pos = -1);
		void GetCaretPos(int &nLine, int &nPos);

		BOOL IsEditingLine();
		void DoPaste();

		afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
		afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);

		DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////
// {{AFX_INSERT_LOCATION}}

#endif // !defined(AFX_CONSOLEBOX_H__3D22F593_4E2E_49EC_8C5E_53257F0F5874__INCLUDED_)
