////////////////////////////////////////////////////////////////////////////// //文件: 进程条对话框定义类 //主要功能: // 在线程中使用进程条 //程序编写: //日期:2011-08-30 // // ///////////////////////////////////////////////////////////////////////////// #pragma once #include "ProgressBase.h" #include "ProgressThreadCtrl.h" /////////////////////////////////////////////////////////////////////////// // CProgressThreadDlg dialog namespace NProgress { class AFX_CLASS_EXPORT CProgressThreadDlg : public CDialog , public CProgressThreadCtrl { DECLARE_DYNAMIC(CProgressThreadDlg) public: CProgressThreadDlg(CWnd* pParent, LPCTSTR lpszDlgTitle=NULL, bool bAllowCancel=true ); // standard constructor virtual ~CProgressThreadDlg(); virtual BOOL Create(CWnd* pParentWnd = NULL); virtual void SetProgressText(LPCTSTR lpszText); protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support virtual BOOL OnInitDialog(); afx_msg void OnBnClickedCancel(); afx_msg LRESULT OnMsgThreadFinish(WPARAM wParam, LPARAM lParam); virtual void ThreadFinished(bool bSucceed); //线程执行结束调用该函数关闭线程并退出对话框 CProgressCtrl m_progress; CStatic m_infoWnd; bool m_bAllowCancel; //Should the Dialog allow PreEmtption by user before Completion? TCHAR m_szCaption[256]; //Fill up with the Title of the DialogBox DECLARE_MESSAGE_MAP() public: afx_msg void OnClose(); }; }//namespace using namespace NProgress;