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. Can we open two Modal Dialogs at Same Time?

Can we open two Modal Dialogs at Same Time?

Scheduled Pinned Locked Moved C / C++ / MFC
question
5 Posts 5 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.
  • 0 Offline
    0 Offline
    002comp
    wrote on last edited by
    #1

    Hello Friends I am creating a win32 based window application.I created one modal Dialog but at the same time while first modal dialog is open I want to open another second modal dialog so for that I created second modal dialog in showWindow of First Modal Dialog. But It is not opening. First of all ,I want to know that can we do it ? Or is any other way to do it? I want to know one more thing that How can I get the Handle of Modal Dialog? Thanks In Advance. Regards Yogesh

    C R L D 4 Replies Last reply
    0
    • 0 002comp

      Hello Friends I am creating a win32 based window application.I created one modal Dialog but at the same time while first modal dialog is open I want to open another second modal dialog so for that I created second modal dialog in showWindow of First Modal Dialog. But It is not opening. First of all ,I want to know that can we do it ? Or is any other way to do it? I want to know one more thing that How can I get the Handle of Modal Dialog? Thanks In Advance. Regards Yogesh

      C Offline
      C Offline
      Cedric Moonen
      wrote on last edited by
      #2

      What do you want to achieve exactly ? That you have the two modal dialogs but only the last opened can be used (so the last one is on top and doesn't allow the first one to be clicked) ? Or do you really want to be able to click on the two dialogs at the same time but not on the rest of your application ? I guess from your question that it is what you want to achieve. In that case, your second dialog has to be a modeless dialog (if you search in the articles of codeproject, you'll find plenty of articles discussing them).

      Cédric Moonen Software developer
      Charting control [v2.0] OpenGL game tutorial in C++

      1 Reply Last reply
      0
      • 0 002comp

        Hello Friends I am creating a win32 based window application.I created one modal Dialog but at the same time while first modal dialog is open I want to open another second modal dialog so for that I created second modal dialog in showWindow of First Modal Dialog. But It is not opening. First of all ,I want to know that can we do it ? Or is any other way to do it? I want to know one more thing that How can I get the Handle of Modal Dialog? Thanks In Advance. Regards Yogesh

        R Offline
        R Offline
        Rajesh R Subramanian
        wrote on last edited by
        #3

        You first need to understand "blocking", "modality" and the relationship between them. I can only tell you that if you really need two modal dialogs to be displayed simultaneously (why would such a thing be needed completely escapes me), then you could spawn the dialogs from two different threads (one could be the main thread). But seriously reconsider what you're doing. Perhaps there's something better that you can do.

        “Follow your bliss.” – Joseph Campbell

        1 Reply Last reply
        0
        • 0 002comp

          Hello Friends I am creating a win32 based window application.I created one modal Dialog but at the same time while first modal dialog is open I want to open another second modal dialog so for that I created second modal dialog in showWindow of First Modal Dialog. But It is not opening. First of all ,I want to know that can we do it ? Or is any other way to do it? I want to know one more thing that How can I get the Handle of Modal Dialog? Thanks In Advance. Regards Yogesh

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Your design is wrong! A modal dialog is used to stop an application while the user enters some information, selects options etc, in order to control the work to be done. The whole idea of modal dialogs is to prevent the user doing anything until the requirements of the dialog have been met. If you need more than one dialog at the same time then the design of your application is seriously flawed.

          1 Reply Last reply
          0
          • 0 002comp

            Hello Friends I am creating a win32 based window application.I created one modal Dialog but at the same time while first modal dialog is open I want to open another second modal dialog so for that I created second modal dialog in showWindow of First Modal Dialog. But It is not opening. First of all ,I want to know that can we do it ? Or is any other way to do it? I want to know one more thing that How can I get the Handle of Modal Dialog? Thanks In Advance. Regards Yogesh

            D Offline
            D Offline
            dxlee
            wrote on last edited by
            #5

            I suggest you merge the two dialog boxes into one model dialog box, for example, in a side-by-side way. When you want to "dismiss" any one of the original dialog boxes, just hide the appropriate side (by using some resizing and/or moving tricks).

            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