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

📄 changepassword2.cpp

📁 一个模仿ATM提款机的MFC程序
💻 CPP
字号:
// Changepassword2.cpp : implementation file
//

#include "stdafx.h"
#include "ATM.h"
#include "Changepassword2.h"

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

/////////////////////////////////////////////////////////////////////////////
// CChangepassword2 dialog


CChangepassword2::CChangepassword2(CWnd* pParent /*=NULL*/)
	: CDialog(CChangepassword2::IDD, pParent)
{
	//{{AFX_DATA_INIT(CChangepassword2)
	m_newpassword2 = _T("");
	//}}AFX_DATA_INIT
}


void CChangepassword2::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CChangepassword2)
	DDX_Control(pDX, IDC_NEWPASSWORD2, m_newedit2);
	DDX_Text(pDX, IDC_NEWPASSWORD2, m_newpassword2);
	//}}AFX_DATA_MAP
	SetTimer(0,15000,NULL);
}


BEGIN_MESSAGE_MAP(CChangepassword2, CDialog)
	//{{AFX_MSG_MAP(CChangepassword2)
	ON_BN_CLICKED(IDC_CORRECT, OnCorrect)
	ON_WM_TIMER()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CChangepassword2 message handlers

void CChangepassword2::OnCorrect() 
{
	// TODO: Add your control notification handler code here
	m_newedit2.SetWindowText("");
	
}

void CChangepassword2::OnOK() 
{
	// TODO: Add extra validation here
	
	CDialog::OnOK();
}

BOOL CChangepassword2::PreTranslateMessage(MSG* pMsg) 
{
	// TODO: Add your specialized code here and/or call the base class
	
	switch(pMsg->message)
	{
	case WM_KEYUP:
		SetTimer(0,15000,NULL);
		if(m_newedit2.GetWindowTextLength()==6)CDialog::OnOK();
		break;
	case WM_KEYDOWN:KillTimer(0);break;
	}
	return CDialog::PreTranslateMessage(pMsg);
}

void CChangepassword2::OnTimer(UINT nIDEvent) 
{
	// TODO: Add your message handler code here and/or call default
	Beep(1000,500);
	KillTimer(0);
	CAlarm alarmdlg;
	alarmdlg.DoModal();
	
	CDialog::OnTimer(nIDEvent);
}

⌨️ 快捷键说明

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