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. Closing Modal Dialog

Closing Modal Dialog

Scheduled Pinned Locked Moved C / C++ / MFC
question
4 Posts 4 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.
  • B Offline
    B Offline
    Big Trev
    wrote on last edited by
    #1

    I have a dialog that is created using dlg.DoModal(); I have a timer funciton running in a seperate thread, created by the dialog. Is it possible to have the thread call Onok() for the dialogue, in order to close the dialogue as if I'd hit ok button? Thanks

    D H A 3 Replies Last reply
    0
    • B Big Trev

      I have a dialog that is created using dlg.DoModal(); I have a timer funciton running in a seperate thread, created by the dialog. Is it possible to have the thread call Onok() for the dialogue, in order to close the dialogue as if I'd hit ok button? Thanks

      D Offline
      D Offline
      dan o
      wrote on last edited by
      #2

      hi, of course is that possible just start a new tread in OnInitDialog() Or just with OnTimer Event of CDialog class and when time is reached/or thread is finished when dialog must close. just call OnOK() or ONCancel() dano

      1 Reply Last reply
      0
      • B Big Trev

        I have a dialog that is created using dlg.DoModal(); I have a timer funciton running in a seperate thread, created by the dialog. Is it possible to have the thread call Onok() for the dialogue, in order to close the dialogue as if I'd hit ok button? Thanks

        H Offline
        H Offline
        Hans Ruck
        wrote on last edited by
        #3

        Call p_dlg->EndDialog(IDOK). rechi

        1 Reply Last reply
        0
        • B Big Trev

          I have a dialog that is created using dlg.DoModal(); I have a timer funciton running in a seperate thread, created by the dialog. Is it possible to have the thread call Onok() for the dialogue, in order to close the dialogue as if I'd hit ok button? Thanks

          A Offline
          A Offline
          Alvaro Mendez
          wrote on last edited by
          #4

          You don't need a separate thread for the timer, by the way. Just call SetTimer inside OnInitDialog and add the OnTimer handler. In there you can call OnOK(). Regards, Alvaro


          The world is a dangerous place, not because of those who do evil, but because of those who look on and do nothing. -- Albert Einstein

          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