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

📄 showbottom.cpp

📁 此代码使用bmp图作为主要界面
💻 CPP
字号:
// ShowBottom.cpp : implementation file
//

#include "stdafx.h"
#include "SuperViseSystem.h"
#include "ShowBottom.h"

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

/////////////////////////////////////////////////////////////////////////////
// CShowBottom

CShowBottom::CShowBottom()
{
}

CShowBottom::~CShowBottom()
{
}


BEGIN_MESSAGE_MAP(CShowBottom, CWnd)
	//{{AFX_MSG_MAP(CShowBottom)
	ON_WM_LBUTTONDOWN()
	ON_WM_PAINT()
	ON_WM_CREATE()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()


/////////////////////////////////////////////////////////////////////////////
// CShowBottom message handlers

BOOL CShowBottom::Create(DWORD dwStyle, CRect& rect, CWnd* pParent, UINT id) 
{
	int result;	

 	result = CWnd::CreateEx(NULL,//WS_EX_WINDOWEDGE , 
		NULL, NULL, dwStyle, 
		rect.left, rect.top, rect.Width(), rect.Height(),
		pParent->GetSafeHwnd(), (HMENU)id) ;
	if( !result )
		AfxMessageBox("Error creating window");

	m_ctlRect = rect ;
	pParent->ClientToScreen(m_ctlRect) ;
	ScreenToClient(m_ctlRect) ;
	//m_MemDC为CDC类的一个对象.
	//m_MemDC1.CreateCompatibleDC(GetDC());// 创建什么东西?

	return result;
}

void CShowBottom::OnLButtonDown(UINT nFlags, CPoint point) 
{	
	CWnd::OnLButtonDown(nFlags, point);
}

void CShowBottom::OnPaint() 
{
    CPaintDC dc(this); // device context for painting	
	// TODO: Add your message handler code here
	if(m_bIsSetImage)
	{
		m_MemDC1.SelectObject(m_bitmap1);
		dc.BitBlt(0,0,790,123,&m_MemDC1,0,0,SRCCOPY);	
	}
}

int CShowBottom::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	if (CWnd::OnCreate(lpCreateStruct) == -1)
		return -1;

    CDC *pDC = GetDC();;
	m_MemDC1.CreateCompatibleDC(pDC);
	m_bitmap1 = (HBITMAP)LoadImage(AfxGetInstanceHandle(),"res\\未标题-1.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE|LR_CREATEDIBSECTION);
	return 0;
}

⌨️ 快捷键说明

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