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

📄 surrogate.cpp

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

#include "stdafx.h"
#include "ATM.h"
#include "Surrogate.h"
#include "Water.h"
#include "GAS.h"



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

/////////////////////////////////////////////////////////////////////////////
// CSurrogate dialog


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


void CSurrogate::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CSurrogate)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
	SetTimer(0,15000,NULL);
}


BEGIN_MESSAGE_MAP(CSurrogate, CDialog)
	//{{AFX_MSG_MAP(CSurrogate)
	ON_WM_TIMER()
	ON_BN_CLICKED(IDOK2, OnOk2)
	ON_BN_CLICKED(IDOK3, OnOk3)
	ON_BN_CLICKED(IDOK4, OnOk4)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CSurrogate message handlers

void CSurrogate::OnOK() 
{
	// TODO: Add extra validation here
			CPhoneno phonenodlg;
			phonenodlg.DoModal();
	
	CDialog::OnOK();
}







BOOL CSurrogate::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);break;
	case WM_KEYDOWN:KillTimer(0);break;
	}
	return CDialog::PreTranslateMessage(pMsg);
}

void CSurrogate::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);
}

void CSurrogate::OnOk2() 
{
	// TODO: Add your control notification handler code here
			TELEPHONE telephonedlg;
			telephonedlg.DoModal();
	
}

void CSurrogate::OnOk3() 
{
	// TODO: Add your control notification handler code here
	WATER waterdlg;
	waterdlg.DoModal();
}

void CSurrogate::OnOk4() 
{
	GAS gasdlg;
	gasdlg.DoModal();
	// TODO: Add your control notification handler code here
	
}

⌨️ 快捷键说明

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