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

📄 splashdlg.cpp

📁 一种新颖的软件启动画面与鸣谢画面的编程实现
💻 CPP
字号:
// SplashDlg.cpp : implementation file
//

#include "stdafx.h"
#include "MySplash.h"
#include "SplashDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CSplashDlg dialog


CSplashDlg::CSplashDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CSplashDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CSplashDlg)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void CSplashDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CSplashDlg)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CSplashDlg, CDialog)
	//{{AFX_MSG_MAP(CSplashDlg)
	ON_WM_TIMER()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CSplashDlg message handlers
BOOL CSplashDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	CRect rect1;   
    GetClientRect(&rect1); 
	y=rect1.Height();
   	m_MemBitmap.init(this);  
    SetTimer(1,20,NULL);    
 
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CSplashDlg::OnTimer(UINT nIDEvent) 
{
	// TODO: Add your message handler code here and/or call default
  CRect   rect;    
  CDC*    pDC = GetDC();
  CDC     dcComp;
  this->GetClientRect(&rect); 
  y--;
  
  m_MemBitmap.Clear( rect.left, rect.top, rect.right, rect.bottom, RGB(0,0,0) );
  //显示文字之前  调用指定的颜色将位图填充 相当于清除屏幕。
  m_MemBitmap.TextOut(36,y,150,  " * * *    鸣   谢    * * *",RGB(50,250,0));   
  m_MemBitmap.TextOut(30,y+50,150, "设计人:王治国",RGB(0,250,0));   
  m_MemBitmap.TextOut(30,y+100,150,"设计单位:华北电力大学控制工程学院 ",RGB(0,250,0));   
  m_MemBitmap.TextOut(30,y+150,150,"联系地址:北京华北电力大学130#",RGB(0,250,0));
  m_MemBitmap.TextOut(30,y+200,150,"邮编:102206",RGB(0,250,0));
  m_MemBitmap.TextOut(30,y+250,150,"E_mail:  wzgnow@163.com ", RGB(0,250,0) );
  dcComp.CreateCompatibleDC(pDC); 
  
  dcComp.SelectObject(&m_MemBitmap); 
  //内存设备环境将位图对象选入 
  pDC->BitBlt(0, 0, rect.Width() , rect.Height(),  &dcComp,  0,0,SRCCOPY);    
  //用位传输函数显示出来
  dcComp.DeleteDC();    
  ReleaseDC(pDC);    
  //释放设备对象
  if(y<=-250)
  { 
     KillTimer(1);
	 CDialog::OnCancel();
  }

  CDialog::OnTimer(nIDEvent);
}

LRESULT CSplashDlg::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) 
{
 if ( message == WM_KEYDOWN ||message == WM_SYSKEYDOWN ||
   message == WM_LBUTTONDOWN ||message == WM_RBUTTONDOWN ||
   message == WM_MBUTTONDOWN ||message == WM_NCLBUTTONDOWN ||
   message == WM_NCRBUTTONDOWN ||message == WM_NCMBUTTONDOWN )
 {
      
	  KillTimer(1);
	  CDialog::OnCancel();
      return TRUE; 
 }
  return CWnd::WindowProc(message, wParam, lParam);
}


⌨️ 快捷键说明

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