BEGIN_MESSAGE_MAP(CProgressDialog, CDialog)
//{{AFX_MSG_MAP(CProgressDialog)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
// CProgressDialog message handlersBOOL CProgressDialog::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
m_ProgressCtrl.SetRange(0, 100);
m_ProgressCtrl.SetPos(0);
SetWindowText(m_Caption);
if (!m_EnableCancel) {
m_CancelButton.ShowWindow(SW_HIDE);
}
DWORD threadID;
m_Thread=CreateThread(NULL, 0,
(LPTHREAD_START_ROUTINE)CProgressDialog::Thread
Proc,(LPVOID)this,0,&threadID);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return
FALSE
}
DWORD WINAPI
CProgressDialog::ThreadProc(CProgressDialog* dlg)
{
DWORD ret=dlg->ProgressProc();
dlg->PostMessage(WM_COMMAND, IDOK);
return ret;
}

