⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme.wzd

📁 《vc++扩展编程实例》源码。运用Visual C++ 5.0或6.0的高级编程技巧
💻 WZD
字号:
/////////////////////////////////////////////////////////////////////
// Example files...
/////////////////////////////////////////////////////////////////////

WzdBtmap.cpp -- CWzdBitmap, a bitmap class that can send its contents
WzdBtmap.h         to a printer device context

/////////////////////////////////////////////////////////////////////
// Modify the View Class...
/////////////////////////////////////////////////////////////////////

// 1) Embed a CWzdBitmap variable in your view class:

	CWzdBitmap m_bitmap;

//2) Comment out the default ID_FILE_PRINT and ID_FILE_PRINT_PREVIEW
// command handlers and use the ClassWizard to add your own:

BEGIN_MESSAGE_MAP(CWzdView, CView)
	//{{AFX_MSG_MAP(CWzdView)
	ON_COMMAND(ID_FILE_PRINT, OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_PREVIEW, OnFilePrintPreview)
	//}}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()


// 3) Fill in these command handlers like so:
void CWzdView::OnFilePrint() 
{
	// capture our view
	CRect rect;
	GetWindowRect(&rect);
	m_bitmap.Capture(rect);

	CView::OnFilePrint();
}

void CWzdView::OnFilePrintPreview() 
{
	// capture our view
	CRect rect;
	GetWindowRect(&rect);
	m_bitmap.Capture(rect);

	CView::OnFilePrintPreview();
}

// 4) Use the ClassWizard to override the OnPrint() function and
// fill it in like so:

void CWzdView::OnPrint(CDC* pDC, CPrintInfo* pInfo) 
{
	// print captured bitmap to pDC
	m_bitmap.Print(pDC);

//	CView::OnPrint(pDC, pInfo);
}


/////////////////////////////////////////////////////////////////////
// From: Visual C++ MFC Programming by Example by John E. Swanke
// Copyright (C) 1999 jeswanke. All rights reserved.
/////////////////////////////////////////////////////////////////////

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -