FtpDownStatusDlg.cpp
上传用户:maryhy001
上传日期:2007-05-02
资源大小:2317k
文件大小:2k
- // FtpDownStatusDlg.cpp : implementation file
- //
- #include "stdafx.h"
- #include "trfAgent.h"
- #include "MainFrm.h"
- #include "FtpWorker.h"
- #include "FtpDownStatusDlg.h"
- /////////////////////////////////////////////////////////////////////////////
- // CFtpDownStatusDlg dialog
- CFtpDownStatusDlg::CFtpDownStatusDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CFtpDownStatusDlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CFtpDownStatusDlg)
- m_oFromToHint = _T("");
- //}}AFX_DATA_INIT
- }
- BOOL CFtpDownStatusDlg::Create(CWnd *pParent, HANDLE hEventKill)
- {
- m_hEventKill = hEventKill;
-
- if(!CDialog::Create(CFtpDownStatusDlg::IDD, pParent))
- {
- return FALSE;
- }
- return TRUE;
- }
- void CFtpDownStatusDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CFtpDownStatusDlg)
- DDX_Control(pDX, IDC_DOWNLOADPROG, m_oDownProgsCtrl);
- DDX_Text(pDX, IDC_FROMTOHINT, m_oFromToHint);
- DDV_MaxChars(pDX, m_oFromToHint, 512);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CFtpDownStatusDlg, CDialog)
- //{{AFX_MSG_MAP(CFtpDownStatusDlg)
- ON_BN_CLICKED(IDCANCELPROG, OnCancelAction)
- ON_WM_DESTROY()
- //}}AFX_MSG_MAP
- ON_MESSAGE(UWM_SETPPROGRESS, OnSetProgressPosition)
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CFtpDownStatusDlg message handlers
- void CFtpDownStatusDlg::OnCancelAction()
- {
- SetEvent(this->m_hEventKill);
- CDialog::OnCancel();
- }
- void CFtpDownStatusDlg::OnSetProgressPosition(WPARAM wp, LPARAM lp)
- {
- switch(wp) {
- case 0:
- this->m_oDownProgsCtrl.SetRange32(0, (int)lp);
- this->m_oDownProgsCtrl.SetPos(0);
- break;
- case 1:
- {
- int npos = this->m_oDownProgsCtrl.GetPos();
- this->m_oDownProgsCtrl.SetPos(npos + (int)lp);
- }
- break;
- case 2:
- this->m_oDownProgsCtrl.SetRange32(0, 0);
- break;
- }
- }
- void CFtpDownStatusDlg::SetHintInfo(LPCSTR lpszHintInfo)
- {
- this->m_oFromToHint = lpszHintInfo;
- this->UpdateData(FALSE);
- }
- void CFtpDownStatusDlg::OnDestroy()
- {
- CDialog::OnDestroy();
- }