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

📄 dialogmsg.cpp

📁 这是书上的代码
💻 CPP
字号:
// DialogMsg.cpp : implementation file
//

#include "stdafx.h"
#include "SortID.h"
#include "DialogMsg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CDialogMsg dialog


CDialogMsg::CDialogMsg(CWnd* pParent /*=NULL*/)
	: CDialog(CDialogMsg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CDialogMsg)
	m_strMessage = _T("");
	//}}AFX_DATA_INIT
	m_nTimerGap=500;
	m_bTimerSeted=FALSE;
}


void CDialogMsg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDialogMsg)
	DDX_Text(pDX, IDC_STATIC_MSG, m_strMessage);
	//}}AFX_DATA_MAP
}


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

/////////////////////////////////////////////////////////////////////////////
// CDialogMsg message handlers

BOOL CDialogMsg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here

	m_bTimerSeted=SetTimer(1, m_nTimerGap, NULL);
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CDialogMsg::OnTimer(UINT nIDEvent) 
{
	// TODO: Add your message handler code here and/or call default
	CDialog::OnTimer(nIDEvent);

	if(m_bTimerSeted)
	{	
		KillTimer(1);
		m_bTimerSeted=FALSE;
	}
	CDialog::OnOK();
}

void CDialogMsg::OnOK() 
{
	// TODO: Add extra validation here
	if(m_bTimerSeted)
	{	
		KillTimer(1);
		m_bTimerSeted=FALSE;
	}
	
	CDialog::OnOK();
}

⌨️ 快捷键说明

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