RecvProgressDlg.cpp
上传用户:weimei12
上传日期:2022-08-11
资源大小:185k
文件大小:2k
源码类别:

Email客户端

开发平台:

Visual C++

  1. // RecvProgressDlg.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "SimpleMail.h"
  5. #include "RecvProgressDlg.h"
  6. // CRecvProgressDlg dialog
  7. IMPLEMENT_DYNAMIC(CRecvProgressDlg, CDialog)
  8. CRecvProgressDlg::CRecvProgressDlg(CWnd* pParent /*=NULL*/)
  9. : CDialog(CRecvProgressDlg::IDD, pParent)
  10. {
  11. }
  12. CRecvProgressDlg::~CRecvProgressDlg()
  13. {
  14. }
  15. void CRecvProgressDlg::DoDataExchange(CDataExchange* pDX)
  16. {
  17. CDialog::DoDataExchange(pDX);
  18. DDX_Control(pDX, IDC_PROGRESS, m_Progress);
  19. }
  20. BEGIN_MESSAGE_MAP(CRecvProgressDlg, CDialog)
  21. ON_WM_DESTROY()
  22. ON_WM_CREATE()
  23. END_MESSAGE_MAP()
  24. void CRecvProgressDlg::UpdateProgress(const int nProgress)
  25. {
  26. m_Progress.SetPos(nProgress);
  27. switch (nProgress)
  28. {
  29. case CONNECT_SERVER_SUCCESS:
  30. GetDlgItem(IDC_STATUS)->SetWindowText("连接服务器成功");
  31. break;
  32. case RECEIVING_MAILS:
  33. GetDlgItem(IDC_STATUS)->SetWindowText("接收邮件中");
  34. break;
  35. case UPDATING_MAILS:
  36. GetDlgItem(IDC_STATUS)->SetWindowText("更新接收的邮件");
  37. break;
  38. case RECEIVED_SUCCESS:
  39. GetDlgItem(IDC_STATUS)->SetWindowText("接收成功");
  40. DestroyWindow();
  41. break;
  42. case RECEIVE_ERRORS:
  43. GetDlgItem(IDC_STATUS)->SetWindowText("接收邮件失败");
  44. DestroyWindow();
  45. break;
  46. default:
  47. GetDlgItem(IDC_STATUS)->SetWindowText("准备连接服务器");
  48. break;
  49. }
  50. }
  51. void CRecvProgressDlg::OnDestroy()
  52. {
  53. CDialog::OnDestroy();
  54. // TODO: 在此处添加消息处理程序代码
  55. delete this;
  56. }
  57. BOOL CRecvProgressDlg::OnInitDialog()
  58. {
  59. CDialog::OnInitDialog();
  60. // TODO:  Add extra initialization here
  61. m_Progress.SetRange(0, 100);
  62. return TRUE;  // return TRUE unless you set the focus to a control
  63. // EXCEPTION: OCX Property Pages should return FALSE
  64. }