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

📄 demo.cpp

📁 模拟电子课程的教学演示程序
💻 CPP
字号:
// Demo.cpp: implementation of the CDemo class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "ElecDemo.h"
#include "Demo.h"

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

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
LPCTSTR CDemo::m_lpszClassName = NULL;

CDemo::CDemo()
{

}

CDemo::~CDemo()
{

}
BOOL CDemo::Create(DWORD dwExStyle, DWORD dwStyle, UINT nPlaceholderID,
				   CWnd* pParentWnd, UINT nID, UINT nDefaultCursorID,
				   UINT nHotCursorID,UINT nBackBmpID)
{
	RECT rect;
	pParentWnd->GetDlgItem(nPlaceholderID)->GetWindowRect(&rect);
	pParentWnd->ScreenToClient(&rect);

	return Create(dwExStyle, dwStyle, rect, pParentWnd, nID, 
		nDefaultCursorID, nHotCursorID,nBackBmpID);
}
BOOL CDemo::Create(DWORD dwExStyle, DWORD dwStyle, const RECT& rect, 
				   CWnd* pParentWnd, UINT nID, UINT nDefaultCursorID, 
				   UINT nHotCursorID,UINT nBackBmpID)
{
	m_Parent=pParentWnd;
	m_hDefaultCursor = nDefaultCursorID == 0 ? NULL : AfxGetApp()->LoadCursor(nDefaultCursorID);
	if(nHotCursorID == 0)
		SetDefaultHotCursor();
	else
		m_hHotCursor=AfxGetApp()->LoadCursor(nHotCursorID);

	// register window class & create CWnd object
	if (m_lpszClassName == NULL)
		m_lpszClassName = AfxRegisterWndClass(CS_HREDRAW|CS_VREDRAW);

	BOOL bResult = CreateEx(dwExStyle, m_lpszClassName, _T(""), dwStyle,
		rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top,
		pParentWnd->GetSafeHwnd(), (HMENU)nID, NULL );

	/*// start scrolling
	if(bResult)
		SetTimer(DYNAMIC_TIMER1,m_nTimerSpeed*10,NULL);*/
	BOOL bsuc;
	m_bmpBack.DeleteObject();
	if(nBackBmpID!=0)
	{
		bsuc=m_bmpBack.LoadBitmap(nBackBmpID);	    	
		if(!bsuc)return FALSE;
	}
	//else bsuc=m_bmpBack.LoadBitmap(IDB_BK);	
	BITMAP bm;
	m_bmpBack.GetBitmap(&bm);
	m_bmpSize.cx=bm.bmWidth;
	m_bmpSize.cy=bm.bmHeight;
	
	return bResult;
}
void CDemo::SetDefaultHotCursor()
{
}

⌨️ 快捷键说明

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