Re: Window is minimized after destroy the modeless dialog
I replaced pDlg->Destroy() with pDlg->PostMessage(WM_CLOSE), but the
modeless dialog is not closed...
Any advise? thanks!
Eileen
Ajay Kalra wrote:
Instead of using DestroyWindow, see if using PostMessage(WM_CLOSE)
helps.
---
Ajay
eileen wrote:
I am working on a program which will load some XML files. Right after
user select a file from the browse dialog, I created a modeless
'Loading file ...please wait' dialog box ,
the modeless 'please wait' dialog box is destroyed using
destroyWindow() after the loading is completed.
The problem is : when the modeless dialog is destroyed, my main dialog
is minimized. What can I do to avoid the main dialog being minimized?
Here is part of my code:
void CMainFrame::OnFileImport()
{
CProgressBar* pDlg = new CProgressBar;
VERIFY( pDlg->Create() );
pDlg->SetWindowPos(&wndTop,300,300,200,50,SWP_NOSIZE);
pDlg->m_pProgressBar.SetRange(0,100);
pDlg->SetWindowText("Loading file...10%completed.");
pDlg->m_pProgressBar.SetPos(10);
...
pDlg->m_pProgressBar.SetPos(100);
pDlg->SetWindowText("Loading file...100% completed.");
Sleep(1000);
pDlg->Destroy();
}
...
BOOL CProgressBar::Destroy()
{
return CDialog::DestroyWindow();
}
Thanks!