Problem to refresh modeless dialog
-
Hi every body, During long processing, i display a modeless dialog like this : CModelessDlg * DlgAttente; // CModelessDlg is my class DlgAttente = new CModelessDlg; DlgAttente->Create(IDD_DIALOG_ATTENTE,this); DlgAttente->ShowWindow(SW_SHOW); DlgAttente->m_Message="Please wait, processing is being......"; DlgAttente->UpdateData(FALSE); m_message is a variable bind to CStatic control ( label ). It shows my messages. This code work well, but if i display another window, for example, windows explorer, Bloc Notes, then close it, my modeless dialog don't refresh. The message show on it by my CStatic disappear without trace. Can anybody help me ?? Thanks in advance
-
Hi every body, During long processing, i display a modeless dialog like this : CModelessDlg * DlgAttente; // CModelessDlg is my class DlgAttente = new CModelessDlg; DlgAttente->Create(IDD_DIALOG_ATTENTE,this); DlgAttente->ShowWindow(SW_SHOW); DlgAttente->m_Message="Please wait, processing is being......"; DlgAttente->UpdateData(FALSE); m_message is a variable bind to CStatic control ( label ). It shows my messages. This code work well, but if i display another window, for example, windows explorer, Bloc Notes, then close it, my modeless dialog don't refresh. The message show on it by my CStatic disappear without trace. Can anybody help me ?? Thanks in advance
You need to process waiting Windows messages during your "long processing". If your long processing is a loop, simply add code like this inside the loop: MSG msg; while (::PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) ::DispatchMessage(&msg); This will periodically dispatch waiting messages -- including the WM_PAINT messages that are waiting to be processed for your dialog. Alternatively, do your "long processing" on a separate thread. Regards, Nick Hodapp