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

📄 wzdlogo.cpp

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

#include "stdafx.h"
#include "WzdLogo.h"

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

/////////////////////////////////////////////////////////////////////////////
// CWzdLogo

CWzdLogo::CWzdLogo()
{
}

CWzdLogo::~CWzdLogo()
{
}


BEGIN_MESSAGE_MAP(CWzdLogo, CWnd)
	//{{AFX_MSG_MAP(CWzdLogo)
	ON_WM_PAINT()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()


/////////////////////////////////////////////////////////////////////////////
// CWzdLogo message handlers

void CWzdLogo::OnPaint() 
{
	CPaintDC dc(this); // device context for painting

	// get bitmap colors
	CPalette *pOldPal = dc.SelectPalette(m_bitmap.GetPalette(),FALSE);
	dc.RealizePalette();

	// get device context to select bitmap into
	CDC dcComp;
	dcComp.CreateCompatibleDC(&dc);
	dcComp.SelectObject(&m_bitmap);

	// draw bitmap
	dc.BitBlt(0,0,m_bitmap.m_Width,m_bitmap.m_Height, &dcComp, 0,0,SRCCOPY);

	// reselect old palette
	dc.SelectPalette(pOldPal,FALSE);
}

void CWzdLogo::CreateBX(CWnd *pWnd, UINT nBitmapID, UINT nChildID )
{
	m_bitmap.LoadBitmapEx(nBitmapID,TRUE);
	CRect rect(0,0,0,0);
	Create(NULL,_T(""),WS_CHILD|WS_VISIBLE,rect,pWnd,nChildID);
}


void CWzdLogo::MoveLogo( int nWidth, int nHeight )
{
	MoveWindow(nWidth-m_bitmap.m_Width,0,m_bitmap.m_Width,nHeight);
}

⌨️ 快捷键说明

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