Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Problem to refresh modeless dialog

Problem to refresh modeless dialog

Scheduled Pinned Locked Moved C / C++ / MFC
helpdebuggingtutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Cheickna
    wrote on last edited by
    #1

    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

    N 1 Reply Last reply
    0
    • C Cheickna

      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

      N Offline
      N Offline
      Nick Hodapp
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups