// myappwin.cpp

#include "myappwin.h"
#include "myapp.h"


extern mylib::CMyApp* g_pApp;

namespace mylib
{

CMyAppWin::CMyAppWin(LPCTSTR szTitle)
{
	Create(szTitle, WS_OVERLAPPEDWINDOW,
		CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, 0, 0);
}

BOOL
CMyAppWin::OnDestroy()
{
	PostQuitMessage(0);
	return TRUE;
}

BOOL
CMyAppWin::OnPaint()
{
	PAINTSTRUCT ps;
	HDC hdc = CMyWin::BeginPaint(&ps);
	g_pApp->m_doc.Draw(hdc, -m_ptOffset.x, -m_ptOffset.y, ps);
	CMyWin::EndPaint(&ps);
	return TRUE;
}

}	// namespace mylib
