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 Window List

MDI Window List

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

    Can anyone tell me how to remove the standard MDI window list in a CMDIFrameWnd ???

    T 1 Reply Last reply
    0
    • 2 2sky

      Can anyone tell me how to remove the standard MDI window list in a CMDIFrameWnd ???

      T Offline
      T Offline
      Tomasz Sowinski
      wrote on last edited by
      #2

      Ensure that your menu has none of the following items:

      ID_WINDOW_NEW
      ID_WINDOW_ARRANGE
      ID_WINDOW_CASCADE
      ID_WINDOW_TILE_HORZ
      ID_WINDOW_TILE_VERT
      ID_WINDOW_SPLIT

      MFC searches through your menu (in CMDIChildWnd::OnUpdateFrameMenu) and uses the rightmost popup containing one of these items as Window menu - the one that gets the window list. Tomasz Sowinski -- http://www.shooltz.com.pl

      2 1 Reply Last reply
      0
      • T Tomasz Sowinski

        Ensure that your menu has none of the following items:

        ID_WINDOW_NEW
        ID_WINDOW_ARRANGE
        ID_WINDOW_CASCADE
        ID_WINDOW_TILE_HORZ
        ID_WINDOW_TILE_VERT
        ID_WINDOW_SPLIT

        MFC searches through your menu (in CMDIChildWnd::OnUpdateFrameMenu) and uses the rightmost popup containing one of these items as Window menu - the one that gets the window list. Tomasz Sowinski -- http://www.shooltz.com.pl

        2 Offline
        2 Offline
        2sky
        wrote on last edited by
        #3

        I don't even have a Window menu... MFC places it on the bottom of my second-last menu... Even if this menu's name is "Test" for example... and my menu items names "Test1", "Test2", ... The Window list is put always on the bottom of them...

        T 1 Reply Last reply
        0
        • 2 2sky

          I don't even have a Window menu... MFC places it on the bottom of my second-last menu... Even if this menu's name is "Test" for example... and my menu items names "Test1", "Test2", ... The Window list is put always on the bottom of them...

          T Offline
          T Offline
          Tomasz Sowinski
          wrote on last edited by
          #4

          Do you understand the difference between menu item name and menu item ID? Changing the names will not help. If you have menu containing items with identifiers like ID_WINDOW_xxx, the window list will be appended. You have to change menu item identifiers. Tomasz Sowinski -- http://www.shooltz.com.pl

          2 1 Reply Last reply
          0
          • T Tomasz Sowinski

            Do you understand the difference between menu item name and menu item ID? Changing the names will not help. If you have menu containing items with identifiers like ID_WINDOW_xxx, the window list will be appended. You have to change menu item identifiers. Tomasz Sowinski -- http://www.shooltz.com.pl

            2 Offline
            2 Offline
            2sky
            wrote on last edited by
            #5

            I do! I don't have a menu which has an ID that starts with ID_WINDOW_ ... As a matter of fact, MFC puts the window list on the "Test" menu's bottom... Which has the ID's: ID_TEST_TEST1 and ID_TEST_TEST2. My Child windows are created through the CMDIChildWnd class' Create method... CSettingsDlg m_settDlg; // Derived from CMDIChildWnd m_settDlg.Create(AfxRegisterWndClass(0, 0, (HBRUSH)COLOR_WINDOW), title, WS_CHILD | WS_VISIBLE | WS_CAPTION | WS_MINIMIZEBOX | WS_SYSMENU, r); m_settDlg.ShowWindow(SW_SHOW);

            T 1 Reply Last reply
            0
            • 2 2sky

              I do! I don't have a menu which has an ID that starts with ID_WINDOW_ ... As a matter of fact, MFC puts the window list on the "Test" menu's bottom... Which has the ID's: ID_TEST_TEST1 and ID_TEST_TEST2. My Child windows are created through the CMDIChildWnd class' Create method... CSettingsDlg m_settDlg; // Derived from CMDIChildWnd m_settDlg.Create(AfxRegisterWndClass(0, 0, (HBRUSH)COLOR_WINDOW), title, WS_CHILD | WS_VISIBLE | WS_CAPTION | WS_MINIMIZEBOX | WS_SYSMENU, r); m_settDlg.ShowWindow(SW_SHOW);

              T Offline
              T Offline
              Tomasz Sowinski
              wrote on last edited by
              #6

              Put the breakpoint in the line 871 of the file WINMDI.CPP located in vc98\mfc\src directory. The line contains this code: return hMenuPop; If your programs stops there, it means one of the following: 1) your menu has some ID_WINDOW_xxx id. 2) your ID_TEST ids have the same value as ID_WINDOW_xxx ones. If breakpoints is not hit and you can see window list in your menu, something strange is going on... Tomasz Sowinski -- http://www.shooltz.com.pl

              2 1 Reply Last reply
              0
              • T Tomasz Sowinski

                Put the breakpoint in the line 871 of the file WINMDI.CPP located in vc98\mfc\src directory. The line contains this code: return hMenuPop; If your programs stops there, it means one of the following: 1) your menu has some ID_WINDOW_xxx id. 2) your ID_TEST ids have the same value as ID_WINDOW_xxx ones. If breakpoints is not hit and you can see window list in your menu, something strange is going on... Tomasz Sowinski -- http://www.shooltz.com.pl

                2 Offline
                2 Offline
                2sky
                wrote on last edited by
                #7

                The debugger doesn't even stop at the start of this function... It is never executed! And my ID-values are different :confused: I think I'm going crazy here X|

                T 1 Reply Last reply
                0
                • 2 2sky

                  The debugger doesn't even stop at the start of this function... It is never executed! And my ID-values are different :confused: I think I'm going crazy here X|

                  T Offline
                  T Offline
                  Tomasz Sowinski
                  wrote on last edited by
                  #8

                  Did you override CMDIFrameWnd::OnUpdateFrameMenu or CMDIChildWnd::OnUpdateFrameMenu in your program? Or maybe you're explicitly calling CMDIFrameWnd::MDISetMenu? Tomasz Sowinski -- http://www.shooltz.com.pl

                  2 1 Reply Last reply
                  0
                  • T Tomasz Sowinski

                    Did you override CMDIFrameWnd::OnUpdateFrameMenu or CMDIChildWnd::OnUpdateFrameMenu in your program? Or maybe you're explicitly calling CMDIFrameWnd::MDISetMenu? Tomasz Sowinski -- http://www.shooltz.com.pl

                    2 Offline
                    2 Offline
                    2sky
                    wrote on last edited by
                    #9

                    Nope, non of these three... If you have a few seconds time, I have send you a VERY small test-case (created within a few minutes from scratch using the MFC wizard) by mail (If you're upset for this, I'm sorry, but I'm quite desperate)...

                    T 1 Reply Last reply
                    0
                    • 2 2sky

                      Nope, non of these three... If you have a few seconds time, I have send you a VERY small test-case (created within a few minutes from scratch using the MFC wizard) by mail (If you're upset for this, I'm sorry, but I'm quite desperate)...

                      T Offline
                      T Offline
                      Tomasz Sowinski
                      wrote on last edited by
                      #10

                      OK, that was easy. Your app doesn't use doc/view architecture. To disable window menu, override OnCreateClient in your CMainFrame class, and put the following code inside:

                      BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
                      {
                      return CreateClient(lpcs, NULL);
                      }

                      Just pass NULL as second parameter to CreateClient - this means that you don't want the Window menu. Tomasz Sowinski -- http://www.shooltz.com.pl

                      2 S 2 Replies Last reply
                      0
                      • T Tomasz Sowinski

                        OK, that was easy. Your app doesn't use doc/view architecture. To disable window menu, override OnCreateClient in your CMainFrame class, and put the following code inside:

                        BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
                        {
                        return CreateClient(lpcs, NULL);
                        }

                        Just pass NULL as second parameter to CreateClient - this means that you don't want the Window menu. Tomasz Sowinski -- http://www.shooltz.com.pl

                        2 Offline
                        2 Offline
                        2sky
                        wrote on last edited by
                        #11

                        Wow, Thanks !!!! :-D I couldn't find this anywhere in the MSDN help files...

                        1 Reply Last reply
                        0
                        • T Tomasz Sowinski

                          OK, that was easy. Your app doesn't use doc/view architecture. To disable window menu, override OnCreateClient in your CMainFrame class, and put the following code inside:

                          BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
                          {
                          return CreateClient(lpcs, NULL);
                          }

                          Just pass NULL as second parameter to CreateClient - this means that you don't want the Window menu. Tomasz Sowinski -- http://www.shooltz.com.pl

                          S Offline
                          S Offline
                          Shashikant_2006
                          wrote on last edited by
                          #12

                          Can you please tell me how to hide/delete the window popup menu from the main menu if I am working with Doc/ View application? Thats really urgent, I am using the code like CMenu *menuVault = this->GetMenu(); ::DeleteMenu(menuVault->GetSafeHmenu(),9,MF_BYPOSITION);//9 is the position of Wondows menu ::DrawMenuBar(::AfxGetMainWnd()->m_hWnd);, everything seems to be ok but menu bar is not getting refreshed or redrawn..... what could be worng????

                          Never complain,never explain,just do your work.

                          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