www.gusucode.com > VC++实现控制窗体标题栏的显示与隐藏功能-源码程序 > VC++实现控制窗体标题栏的显示与隐藏功能-源码程序/code/ViewTitleBarView.cpp

    // ViewTitleBarView.cpp : implementation of the CViewTitleBarView class
// download by http://www.NewXing.com

#include "stdafx.h"
#include "ViewTitleBar.h"

#include "ViewTitleBarDoc.h"
#include "ViewTitleBarView.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CViewTitleBarView

IMPLEMENT_DYNCREATE(CViewTitleBarView, CView)

BEGIN_MESSAGE_MAP(CViewTitleBarView, CView)
	//{{AFX_MSG_MAP(CViewTitleBarView)
		// NOTE - the ClassWizard will add and remove mapping macros here.
		//    DO NOT EDIT what you see in these blocks of generated code!
	//}}AFX_MSG_MAP
	// Standard printing commands
	ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CViewTitleBarView construction/destruction

CViewTitleBarView::CViewTitleBarView()
{
	// TODO: add construction code here

}

CViewTitleBarView::~CViewTitleBarView()
{
}

BOOL CViewTitleBarView::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CViewTitleBarView drawing

void CViewTitleBarView::OnDraw(CDC* pDC)
{
	CViewTitleBarDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	// TODO: add draw code for native data here
}

/////////////////////////////////////////////////////////////////////////////
// CViewTitleBarView printing

BOOL CViewTitleBarView::OnPreparePrinting(CPrintInfo* pInfo)
{
	// default preparation
	return DoPreparePrinting(pInfo);
}

void CViewTitleBarView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add extra initialization before printing
}

void CViewTitleBarView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add cleanup after printing
}

/////////////////////////////////////////////////////////////////////////////
// CViewTitleBarView diagnostics

#ifdef _DEBUG
void CViewTitleBarView::AssertValid() const
{
	CView::AssertValid();
}

void CViewTitleBarView::Dump(CDumpContext& dc) const
{
	CView::Dump(dc);
}

CViewTitleBarDoc* CViewTitleBarView::GetDocument() // non-debug version is inline
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CViewTitleBarDoc)));
	return (CViewTitleBarDoc*)m_pDocument;
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CViewTitleBarView message handlers