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. MDI Child Window + top most

MDI Child Window + top most

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
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.
  • S Offline
    S Offline
    Sarvan AL
    wrote on last edited by
    #1

    Hi all, How to make an MDI child window top most among all other children? Thanks in advance, Sarvan AL

    N 1 Reply Last reply
    0
    • S Sarvan AL

      Hi all, How to make an MDI child window top most among all other children? Thanks in advance, Sarvan AL

      N Offline
      N Offline
      Nibu babu thomas
      wrote on last edited by
      #2

      MDIActivate(...)


      Nibu thomas Software Developer

      S 1 Reply Last reply
      0
      • N Nibu babu thomas

        MDIActivate(...)


        Nibu thomas Software Developer

        S Offline
        S Offline
        Sarvan AL
        wrote on last edited by
        #3

        Hi Nibu, Thanks for your reply. It (say WND-A) need not be active. If I select other child window (say WND-B), WND-A should be top most among them and WND-B should be active. How can we make it possible? Sarvan AL

        N 1 Reply Last reply
        0
        • S Sarvan AL

          Hi Nibu, Thanks for your reply. It (say WND-A) need not be active. If I select other child window (say WND-B), WND-A should be top most among them and WND-B should be active. How can we make it possible? Sarvan AL

          N Offline
          N Offline
          Nibu babu thomas
          wrote on last edited by
          #4

          Have you tried SetWindowPos. I am a bit tentative about this but you can try.


          Nibu thomas Software Developer

          S 1 Reply Last reply
          0
          • N Nibu babu thomas

            Have you tried SetWindowPos. I am a bit tentative about this but you can try.


            Nibu thomas Software Developer

            S Offline
            S Offline
            Sarvan AL
            wrote on last edited by
            #5

            Hi Nibu, I tried "SetWindowPos" in view::OnInitialUpdate, like, GetParent()->SetWindowPos(...). It doesn't work. Even I tried WS_EX_TOPMOST in CChildFrame::PreCreateWindow. What can we do now? Sarvan AL

            N 1 Reply Last reply
            0
            • S Sarvan AL

              Hi Nibu, I tried "SetWindowPos" in view::OnInitialUpdate, like, GetParent()->SetWindowPos(...). It doesn't work. Even I tried WS_EX_TOPMOST in CChildFrame::PreCreateWindow. What can we do now? Sarvan AL

              N Offline
              N Offline
              Nibu babu thomas
              wrote on last edited by
              #6

              Sarvan AL wrote:

              GetParent()->SetWindowPos(...).

              Why are you calling the parent's(GetParent()) SetWindowPos. You want to make this child window top most right? So call SetWindowPos for this child window. I guess it will make this child window the topmost in the parent window's child window hierarchy. Note: I haven't checked it.


              Nibu thomas Software Developer

              S 1 Reply Last reply
              0
              • N Nibu babu thomas

                Sarvan AL wrote:

                GetParent()->SetWindowPos(...).

                Why are you calling the parent's(GetParent()) SetWindowPos. You want to make this child window top most right? So call SetWindowPos for this child window. I guess it will make this child window the topmost in the parent window's child window hierarchy. Note: I haven't checked it.


                Nibu thomas Software Developer

                S Offline
                S Offline
                Sarvan AL
                wrote on last edited by
                #7

                Hi Nibu, Even this also, doesn't give desired results. void CMyView::OnInitialUpdate() { CFormView::OnInitialUpdate() ; ResizeParentToFit() ; SetWindowPos(&wndTopMost, 0, 0, 100, 100, SWP_NOMOVE | SWP_NOSIZE) ; } But I am not sure that, it is possible to make an MDI child top most. Kindly let know the properties (window styles), the CWnd derived class should have. Sarvan AL

                R 1 Reply Last reply
                0
                • S Sarvan AL

                  Hi Nibu, Even this also, doesn't give desired results. void CMyView::OnInitialUpdate() { CFormView::OnInitialUpdate() ; ResizeParentToFit() ; SetWindowPos(&wndTopMost, 0, 0, 100, 100, SWP_NOMOVE | SWP_NOSIZE) ; } But I am not sure that, it is possible to make an MDI child top most. Kindly let know the properties (window styles), the CWnd derived class should have. Sarvan AL

                  R Offline
                  R Offline
                  Russell
                  wrote on last edited by
                  #8

                  I think that using GetParent() or GetParentFrame() is better. void CMyView::OnInitialUpdate() { CFormView::OnInitialUpdate() ; ResizeParentToFit() ; GetParentFrame()->SetWindowPos(&wndTopMost, 0,0,0,0,SWP_NOMOVE|SWP_NOSIZE) ; }

                  Sarvan AL wrote:

                  But I am not sure that, it is possible to make an MDI child top most.

                  This could be the real problem!

                  S 1 Reply Last reply
                  0
                  • R Russell

                    I think that using GetParent() or GetParentFrame() is better. void CMyView::OnInitialUpdate() { CFormView::OnInitialUpdate() ; ResizeParentToFit() ; GetParentFrame()->SetWindowPos(&wndTopMost, 0,0,0,0,SWP_NOMOVE|SWP_NOSIZE) ; }

                    Sarvan AL wrote:

                    But I am not sure that, it is possible to make an MDI child top most.

                    This could be the real problem!

                    S Offline
                    S Offline
                    Sarvan AL
                    wrote on last edited by
                    #9

                    Hi Russel and Nibu, Still the same prob. Let me explain the scenario briefly: I have 7 CFormView derived views. Those should be always topmost. I should have made those windows as MODELESS DIALOGS. But I made a mistake. I need to change the entire architecture of the application. It is painful. If is there any other alternative (to make an MDI child as MODELESS DIALOG), it would be a great solution. Kindly let me know your suggestion. Sarvan AL

                    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