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

📄 dialogtimer.cpp

📁 VC—网络与通信
💻 CPP
字号:
// DialogTimer.cpp : implementation file
//

#include "stdafx.h"
#include "MirrorGuide.h"
#include "DialogTimer.h"

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

/////////////////////////////////////////////////////////////////////////////
// CDialogTimer dialog


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


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


BEGIN_MESSAGE_MAP(CDialogTimer, CDialog)
	//{{AFX_MSG_MAP(CDialogTimer)
	ON_WM_LBUTTONDOWN()
	ON_WM_TIMER()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDialogTimer message handlers

BOOL CDialogTimer::OnInitDialog() 
{
	CDialog::OnInitDialog();
	SetTimer ( 1, 1000, NULL );	
	// TODO: Add extra initialization here
	int i,j;
	i = GetSystemMetrics ( SM_CXSCREEN ); 
	j = GetSystemMetrics ( SM_CYSCREEN );
	MoveWindow( (i - 400)/2, (j - 90)/2, 400, 90 );
	SetDlgItemInt ( IDC_STATICCOUNT, count );
	return TRUE;  // return TRUE unless you set the focus to a control
}

void CDialogTimer::OnLButtonDown(UINT nFlags, CPoint point) 
{
	KillTimer ( 1 );
	OnCancel ();
	CDialog::OnLButtonDown(nFlags, point);
}

void CDialogTimer::OnTimer(UINT nIDEvent) 
{
	// TODO: Add your message handler code here and/or call default
	if ( count > 1 )
		SetDlgItemInt ( IDC_STATICCOUNT, --count );
	else
		OnOK();
	CDialog::OnTimer(nIDEvent);
}

⌨️ 快捷键说明

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