YesNoDlg.cpp 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // YesNoDlg.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "uphonebox.h"
  5. #include "YesNoDlg.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // YesNoDlg dialog
  13. YesNoDlg::YesNoDlg(CWnd* pParent /*=NULL*/)
  14. : CDialog(YesNoDlg::IDD, pParent)
  15. {
  16. //{{AFX_DATA_INIT(YesNoDlg)
  17. // NOTE: the ClassWizard will add member initialization here
  18. //}}AFX_DATA_INIT
  19. }
  20. void YesNoDlg::DoDataExchange(CDataExchange* pDX)
  21. {
  22. CDialog::DoDataExchange(pDX);
  23. //{{AFX_DATA_MAP(YesNoDlg)
  24. // NOTE: the ClassWizard will add DDX and DDV calls here
  25. //}}AFX_DATA_MAP
  26. }
  27. BEGIN_MESSAGE_MAP(YesNoDlg, CDialog)
  28. //{{AFX_MSG_MAP(YesNoDlg)
  29. ON_WM_TIMER()
  30. //}}AFX_MSG_MAP
  31. END_MESSAGE_MAP()
  32. /////////////////////////////////////////////////////////////////////////////
  33. // YesNoDlg message handlers
  34. BOOL YesNoDlg::OnInitDialog()
  35. {
  36. CDialog::OnInitDialog();
  37. // TODO: Add extra initialization here
  38. m_timer = 0;
  39. SetTimer(1, 1000, NULL);
  40. return TRUE; // return TRUE unless you set the focus to a control
  41. // EXCEPTION: OCX Property Pages should return FALSE
  42. }
  43. void YesNoDlg::OnTimer(UINT nIDEvent)
  44. {
  45. // TODO: Add your message handler code here and/or call default
  46. m_timer++;
  47. CString str;
  48. str.Format("·ñ(%d)", 60 - m_timer);
  49. GetDlgItem(IDCANCEL)->SetWindowText(str);
  50. if (m_timer >= 60)
  51. {
  52. CDialog::OnCancel();
  53. }
  54. }