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. handle to a child window

handle to a child window

Scheduled Pinned Locked Moved C / C++ / MFC
tutorial
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.
  • R Offline
    R Offline
    radhika28
    wrote on last edited by
    #1

    Hi, Mine is a SDI application with different form views.I have button controls in the form views.When clicked on these buttons some dilaogs will open.How to get the handle to the child window which is opened when clicked on buttons. Thanks.

    N 1 Reply Last reply
    0
    • R radhika28

      Hi, Mine is a SDI application with different form views.I have button controls in the form views.When clicked on these buttons some dilaogs will open.How to get the handle to the child window which is opened when clicked on buttons. Thanks.

      N Offline
      N Offline
      Nishad S
      wrote on last edited by
      #2

      radhika28 wrote:

      some dilaogs will open

      Are those dialogs shown as modal?

      - NS -

      R 1 Reply Last reply
      0
      • N Nishad S

        radhika28 wrote:

        some dilaogs will open

        Are those dialogs shown as modal?

        - NS -

        R Offline
        R Offline
        radhika28
        wrote on last edited by
        #3

        All are Modal dialogs

        N 1 Reply Last reply
        0
        • R radhika28

          All are Modal dialogs

          N Offline
          N Offline
          Nishad S
          wrote on last edited by
          #4

          Once we have discussed something like this, right? The same can be used here too... Try this[^]

          - NS -

          R 1 Reply Last reply
          0
          • N Nishad S

            Once we have discussed something like this, right? The same can be used here too... Try this[^]

            - NS -

            R Offline
            R Offline
            radhika28
            wrote on last edited by
            #5

            ya that is true but,I had another problem i.e when i opened a dilaog from one of the views and opened a dilaog from the tray menu option with out closing the first one.So,i will have two modal dilaogs opened.Now when i close one window,i am able to access the main window even though one modal dialog is opened,which is a odd behavior.So,i want to get the handle of the child window,which remained when i close one of the window's and disable the main window untill the child window is closed.Is it correct or there is any other option. Thanks

            N R 2 Replies Last reply
            0
            • R radhika28

              ya that is true but,I had another problem i.e when i opened a dilaog from one of the views and opened a dilaog from the tray menu option with out closing the first one.So,i will have two modal dilaogs opened.Now when i close one window,i am able to access the main window even though one modal dialog is opened,which is a odd behavior.So,i want to get the handle of the child window,which remained when i close one of the window's and disable the main window untill the child window is closed.Is it correct or there is any other option. Thanks

              N Offline
              N Offline
              Nishad S
              wrote on last edited by
              #6

              Is it good to show two modal dialogs at the same time? From my point of view, I dont like it... anyway I am not sure about your requirements. So I think your idea of disabling the main window is not bad. Then you will get the window handle from dialog object if it is set as global or member object.

              - NS -

              R 1 Reply Last reply
              0
              • N Nishad S

                Is it good to show two modal dialogs at the same time? From my point of view, I dont like it... anyway I am not sure about your requirements. So I think your idea of disabling the main window is not bad. Then you will get the window handle from dialog object if it is set as global or member object.

                - NS -

                R Offline
                R Offline
                radhika28
                wrote on last edited by
                #7

                Thanks.I will try it.

                N 1 Reply Last reply
                0
                • R radhika28

                  ya that is true but,I had another problem i.e when i opened a dilaog from one of the views and opened a dilaog from the tray menu option with out closing the first one.So,i will have two modal dilaogs opened.Now when i close one window,i am able to access the main window even though one modal dialog is opened,which is a odd behavior.So,i want to get the handle of the child window,which remained when i close one of the window's and disable the main window untill the child window is closed.Is it correct or there is any other option. Thanks

                  R Offline
                  R Offline
                  Roger Broomfield
                  wrote on last edited by
                  #8

                  In my opinion your problem isn't in the main window. When you display a Modal Dialog from the main window, it will automatically apply the WS_DISABLED style to the main window (check it out using the Spy++ tool), so what you propose really won't make any difference. Your problem is in the handler for the tray menu, where you are allowing the selecting of the menu option to open another modal dialog even though the main window is disabled. Your tray menu handler should process WM_INITMENU and check whether or not the main window is disabled and enable menu options accordingly.

                  1 Reply Last reply
                  0
                  • R radhika28

                    Thanks.I will try it.

                    N Offline
                    N Offline
                    Nishad S
                    wrote on last edited by
                    #9

                    Welcome :) Take care of that point, Roger Broomfield said, if you dont need to show two dialogs at the same time.

                    - NS -

                    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