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. Always on top (modeless) dialog box

Always on top (modeless) dialog box

Scheduled Pinned Locked Moved C / C++ / MFC
wpfquestion
9 Posts 3 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.
  • H Offline
    H Offline
    Hadi Dayvary
    wrote on last edited by
    #1

    Hi I want to show a modeless dialog (in a SDI project) that I can use it when any other modal dialog of project is open. I set the always on top style so I can see it when any other project's modal dialog is open, but I can't use it. I must close the modal dialog first and after that I can use my first dialog(modeless). I set the parent window to CMainFrame and then NULL, but both ways did not work fine. Also I tested some other styles, but found nothing. Is there any way to do this?

    www.logicsims.ir

    D B 2 Replies Last reply
    0
    • H Hadi Dayvary

      Hi I want to show a modeless dialog (in a SDI project) that I can use it when any other modal dialog of project is open. I set the always on top style so I can see it when any other project's modal dialog is open, but I can't use it. I must close the modal dialog first and after that I can use my first dialog(modeless). I set the parent window to CMainFrame and then NULL, but both ways did not work fine. Also I tested some other styles, but found nothing. Is there any way to do this?

      www.logicsims.ir

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      Hadi Dayvary wrote:

      ...but I can't use it.

      Why? What's the problem? Does it show but can't be interacted with? Does it show but stays in the background? Does it fail to show? How, and when, are you displaying it?

      Hadi Dayvary wrote:

      I must close the modal dialog first and after that I can use my first dialog(modeless).

      This sounds like normal behavior of a modal dialog.

      "One man's wage rise is another man's price increase." - Harold Wilson

      "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

      "Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous

      H 1 Reply Last reply
      0
      • D David Crow

        Hadi Dayvary wrote:

        ...but I can't use it.

        Why? What's the problem? Does it show but can't be interacted with? Does it show but stays in the background? Does it fail to show? How, and when, are you displaying it?

        Hadi Dayvary wrote:

        I must close the modal dialog first and after that I can use my first dialog(modeless).

        This sounds like normal behavior of a modal dialog.

        "One man's wage rise is another man's price increase." - Harold Wilson

        "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

        "Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous

        H Offline
        H Offline
        Hadi Dayvary
        wrote on last edited by
        #3

        it's shown but can't be interacted with. I have created it in CMainFrame::OnCreate() like this :

        m_dlgCalling.Create(IDD_CALLING, NULL);
        m_dlgCalling.ShowWindow(SW_SHOW);

        or this:

        m_dlgCalling.Create(IDD_CALLING, this);
        m_dlgCalling.ShowWindow(SW_SHOW);

        www.logicsims.ir

        D 1 Reply Last reply
        0
        • H Hadi Dayvary

          Hi I want to show a modeless dialog (in a SDI project) that I can use it when any other modal dialog of project is open. I set the always on top style so I can see it when any other project's modal dialog is open, but I can't use it. I must close the modal dialog first and after that I can use my first dialog(modeless). I set the parent window to CMainFrame and then NULL, but both ways did not work fine. Also I tested some other styles, but found nothing. Is there any way to do this?

          www.logicsims.ir

          B Offline
          B Offline
          basementman
          wrote on last edited by
          #4

          You can always create the modeless dialog via it's own UI thread. The issue is the modal dialog is preventing pumping of your messages.

          onwards and upwards...

          H 1 Reply Last reply
          0
          • H Hadi Dayvary

            it's shown but can't be interacted with. I have created it in CMainFrame::OnCreate() like this :

            m_dlgCalling.Create(IDD_CALLING, NULL);
            m_dlgCalling.ShowWindow(SW_SHOW);

            or this:

            m_dlgCalling.Create(IDD_CALLING, this);
            m_dlgCalling.ShowWindow(SW_SHOW);

            www.logicsims.ir

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            So you are creating and showing the modeless dialog during the creation of the main frame, correct? Where does the modal dialog play into this?

            "One man's wage rise is another man's price increase." - Harold Wilson

            "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

            "Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous

            H 1 Reply Last reply
            0
            • D David Crow

              So you are creating and showing the modeless dialog during the creation of the main frame, correct? Where does the modal dialog play into this?

              "One man's wage rise is another man's price increase." - Harold Wilson

              "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

              "Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous

              H Offline
              H Offline
              Hadi Dayvary
              wrote on last edited by
              #6

              modal dialogs come when user selects an item from the menu.

              www.logicsims.ir

              D 1 Reply Last reply
              0
              • B basementman

                You can always create the modeless dialog via it's own UI thread. The issue is the modal dialog is preventing pumping of your messages.

                onwards and upwards...

                H Offline
                H Offline
                Hadi Dayvary
                wrote on last edited by
                #7

                thanks. Do you mean that I must create create a thread and then craeting the modeless dialog from that?

                www.logicsims.ir

                1 Reply Last reply
                0
                • H Hadi Dayvary

                  modal dialogs come when user selects an item from the menu.

                  www.logicsims.ir

                  D Offline
                  D Offline
                  David Crow
                  wrote on last edited by
                  #8

                  And by definition, modal dialogs must be dismissed before you can interact with any windows behind them.

                  "One man's wage rise is another man's price increase." - Harold Wilson

                  "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                  "Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous

                  H 1 Reply Last reply
                  0
                  • D David Crow

                    And by definition, modal dialogs must be dismissed before you can interact with any windows behind them.

                    "One man's wage rise is another man's price increase." - Harold Wilson

                    "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                    "Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous

                    H Offline
                    H Offline
                    Hadi Dayvary
                    wrote on last edited by
                    #9

                    I know, but I must do this for our project, There must be a way to do something like this.

                    www.logicsims.ir

                    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