dialogsplash.cpp

来自「虚拟光驱程序」· C++ 代码 · 共 102 行

CPP
102
字号
// DialogSplash.cpp : implementation file
//

#include "stdafx.h"
#include "Speedcd.h"
#include "DialogSplash.h"

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

/////////////////////////////////////////////////////////////////////////////
// CDialogSplash dialog


CDialogSplash::CDialogSplash(CWnd* pParent /*=NULL*/)
	: CDialog(CDialogSplash::IDD, pParent)
{
	//{{AFX_DATA_INIT(CDialogSplash)
		m_sNagText = _T("");
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
	m_iNagCount = 0;
	m_bOkayToGo = FALSE;
}


void CDialogSplash::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDialogSplash)
		DDX_Control(pDX, IDCANCEL, m_cCancel);
     	DDX_Text(pDX, IDC_NAG_TEXT, m_sNagText);

		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


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

/////////////////////////////////////////////////////////////////////////////
// CDialogSplash message handlers

void CDialogSplash::OnCancel() 
{
	// TODO: Add extra cleanup here
	if (m_bOkayToGo)
		CDialog::OnCancel();
	
}

void CDialogSplash::OnTimer(UINT nIDEvent) 
{
	// TODO: Add your message handler code here and/or call default
	if (IDOK == nIDEvent)
	{
		m_iNagCount++;

		if (m_iNagCount > 3)
		{
			m_bOkayToGo = TRUE;
			m_sNagText = "";
			m_cCancel.EnableWindow(TRUE);
			SendMessage(WM_COMMAND, IDCANCEL);
		}else
		{
			m_sNagText = 
					"SpeedCD Virtual CD-ROM Version 1.0\n"
					"Copyright (C) 2003 DaYee Software Studio\n"
					"This is Share software, and you are welcome"
					"to redistribute it under certain conditions;"
					"read license.txt for details";
			SetTimer(IDOK,1000,NULL);
		}
		UpdateData(FALSE);
		UpdateWindow();

	}else
		CDialog::OnTimer(nIDEvent);

}

BOOL CDialogSplash::OnInitDialog() 
{
		CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	SetTimer(IDOK,800,NULL);
	OnTimer(IDOK);
	m_cCancel.EnableWindow(FALSE);
	return TRUE; 
	 // return TRUE unless you set the focus to a control
	 // EXCEPTION: OCX Property Pages should return FALSE
}

⌨️ 快捷键说明

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