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

📄 newclientwnd.cpp

📁 客户端服务器源码
💻 CPP
字号:
// NewClientWnd.cpp : implementation file
//

#include "stdafx.h"
#include "clientMain.h"
#include "NewClientWnd.h"

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

/////////////////////////////////////////////////////////////////////////////
// CNewClientWnd

CNewClientWnd::CNewClientWnd()
{
	m_bitmap.LoadBitmap( IDB_BKGROUDMP );
}

CNewClientWnd::~CNewClientWnd()
{
}

BEGIN_MESSAGE_MAP(CNewClientWnd, CWnd)
	//{{AFX_MSG_MAP(CNewClientWnd)
	ON_WM_ERASEBKGND()
	ON_WM_SIZE()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()


/////////////////////////////////////////////////////////////////////////////
// CNewClientWnd message handlers

BOOL CNewClientWnd::OnEraseBkgnd(CDC* pDC) 
{
	// TODO: Add your message handler code here and/or call default
	// 1 - Create a memory DC and select our bitmap into it
	CDC dcMem;
	dcMem.CreateCompatibleDC( pDC );
	CBitmap* pOldBitmap = dcMem.SelectObject( &m_bitmap );

	// 2 - Retrieve the size of our bitmap...
	BITMAP bmp;
	m_bitmap.GetObject( sizeof( bmp ), &bmp );

	// 3 - ... and the size of our window's client area
	CRect rect;
	GetClientRect( &rect );

	// 4 - Fill the window's client area with our bitmap
	pDC->StretchBlt(	rect.left, rect.top,
						rect.Width(), rect.Height(),
						&dcMem,
						0, 0, bmp.bmWidth, bmp.bmHeight,
						SRCCOPY );

	dcMem.SelectObject( pOldBitmap );
	
	return TRUE;
	//return CWnd::OnEraseBkgnd(pDC);
}

void CNewClientWnd::OnSize(UINT nType, int cx, int cy) 
{
	CWnd::OnSize(nType, cx, cy);
	
	Invalidate( TRUE );
	// TODO: Add your message handler code here
	
}

⌨️ 快捷键说明

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