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 Menu

MDI Menu

Scheduled Pinned Locked Moved C / C++ / MFC
questionhelp
3 Posts 2 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.
  • A Offline
    A Offline
    albuemil
    wrote on last edited by
    #1

    Hy. I'm developing an MDI application, and i've got a problem. I'm trying to add submenus to the main menu, but i can't get the MDI menu, only the main APP menu. I tried with GetMenu, but that only returns the Main App menu. How can i get a pointer to the MDI menu ???

    R 1 Reply Last reply
    0
    • A albuemil

      Hy. I'm developing an MDI application, and i've got a problem. I'm trying to add submenus to the main menu, but i can't get the MDI menu, only the main APP menu. I tried with GetMenu, but that only returns the Main App menu. How can i get a pointer to the MDI menu ???

      R Offline
      R Offline
      Roger Allen
      wrote on last edited by
      #2

      The menu's used in MDI are: CMainFrame::m_hMenuDefault (when no windows are open) CDocTemplate::m_hMenuShared (for each doc template added) You will need to modify these menu resources. AfxGetMainWnd()->m_hMenuDefault; for doctemplates CDocManager *pDocMan = AfxGetApp()->m_pDocManager; POSITION pos = pDocMan->GetFirstDocTemplatePosition(); while (pos) { CDocTemplate *pDocTemplate = pDocMan->GetNextDocTemplate(pos); } Thats just a quick overview. Hope its of help. Roger Allen Sonork 100.10016 Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003

      A 1 Reply Last reply
      0
      • R Roger Allen

        The menu's used in MDI are: CMainFrame::m_hMenuDefault (when no windows are open) CDocTemplate::m_hMenuShared (for each doc template added) You will need to modify these menu resources. AfxGetMainWnd()->m_hMenuDefault; for doctemplates CDocManager *pDocMan = AfxGetApp()->m_pDocManager; POSITION pos = pDocMan->GetFirstDocTemplatePosition(); while (pos) { CDocTemplate *pDocTemplate = pDocMan->GetNextDocTemplate(pos); } Thats just a quick overview. Hope its of help. Roger Allen Sonork 100.10016 Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003

        A Offline
        A Offline
        albuemil
        wrote on last edited by
        #3

        Thanx, it worked. The only problem was, that CDocTemplate doesn't contain the m_hMenuShared, the CMDIDocTemplate contains it, so here's how i made it : POSITION pos = pDocMan->GetFirstDocTemplatePosition(); while (pos) { CMultiDocTemplate *pDocTemplate = (CMultiDocTemplate*)pDocMan->GetNextDocTemplate(pos); } ::InsertMenu(pDocTemplate->m_hMenuShared,1,MF_BYPOSITION | MF_POPUP, (UINT)pMenu->m_hMenu, "submenu"); wich added the "submenu" just after "File".

        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