// YesNoDlg.cpp : implementation file // #include "stdafx.h" #include "uphonebox.h" #include "YesNoDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // YesNoDlg dialog YesNoDlg::YesNoDlg(CWnd* pParent /*=NULL*/) : CDialog(YesNoDlg::IDD, pParent) { //{{AFX_DATA_INIT(YesNoDlg) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT } void YesNoDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(YesNoDlg) // NOTE: the ClassWizard will add DDX and DDV calls here //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(YesNoDlg, CDialog) //{{AFX_MSG_MAP(YesNoDlg) ON_WM_TIMER() //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // YesNoDlg message handlers BOOL YesNoDlg::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here m_timer = 0; SetTimer(1, 1000, NULL); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void YesNoDlg::OnTimer(UINT nIDEvent) { // TODO: Add your message handler code here and/or call default m_timer++; CString str; str.Format("·ñ(%d)", 60 - m_timer); GetDlgItem(IDCANCEL)->SetWindowText(str); if (m_timer >= 60) { CDialog::OnCancel(); } }