RecvProgressDlg.cpp
上传用户:weimei12
上传日期:2022-08-11
资源大小:185k
文件大小:2k
- // RecvProgressDlg.cpp : implementation file
- //
- #include "stdafx.h"
- #include "SimpleMail.h"
- #include "RecvProgressDlg.h"
- // CRecvProgressDlg dialog
- IMPLEMENT_DYNAMIC(CRecvProgressDlg, CDialog)
- CRecvProgressDlg::CRecvProgressDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CRecvProgressDlg::IDD, pParent)
- {
- }
- CRecvProgressDlg::~CRecvProgressDlg()
- {
- }
- void CRecvProgressDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- DDX_Control(pDX, IDC_PROGRESS, m_Progress);
- }
- BEGIN_MESSAGE_MAP(CRecvProgressDlg, CDialog)
- ON_WM_DESTROY()
- ON_WM_CREATE()
- END_MESSAGE_MAP()
- void CRecvProgressDlg::UpdateProgress(const int nProgress)
- {
- m_Progress.SetPos(nProgress);
- switch (nProgress)
- {
- case CONNECT_SERVER_SUCCESS:
- GetDlgItem(IDC_STATUS)->SetWindowText("连接服务器成功");
- break;
- case RECEIVING_MAILS:
- GetDlgItem(IDC_STATUS)->SetWindowText("接收邮件中");
- break;
- case UPDATING_MAILS:
- GetDlgItem(IDC_STATUS)->SetWindowText("更新接收的邮件");
- break;
- case RECEIVED_SUCCESS:
- GetDlgItem(IDC_STATUS)->SetWindowText("接收成功");
- DestroyWindow();
- break;
- case RECEIVE_ERRORS:
- GetDlgItem(IDC_STATUS)->SetWindowText("接收邮件失败");
- DestroyWindow();
- break;
- default:
- GetDlgItem(IDC_STATUS)->SetWindowText("准备连接服务器");
- break;
- }
- }
- void CRecvProgressDlg::OnDestroy()
- {
- CDialog::OnDestroy();
- // TODO: 在此处添加消息处理程序代码
- delete this;
- }
- BOOL CRecvProgressDlg::OnInitDialog()
- {
- CDialog::OnInitDialog();
- // TODO: Add extra initialization here
- m_Progress.SetRange(0, 100);
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }