CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2002
    Posts
    124

    How to show File menu

    Hello,
    I have an MDI application using different menus depending on the current document template in use.

    I need to show the top-level File Menu from the IDR_MAINFRAME window when a command is sent from the active document.

    I would like to application to deactivate the active child window and then show the File menu as if the alt-F key was pressed from the keyboard.

    I have tried CMenu *pMenu=AfxGetMainWnd()->GetMenu();
    but this does not display the menu at all.

    Thanks...

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: How to show File menu

    Quote Originally Posted by robertpantangco View Post
    I would like to application to deactivate the active child window and then show the File menu as if the alt-F key was pressed from the keyboard.
    Maybe you'll just use SendInput to send alt-F keys?
    Victor Nijegorodov

  3. #3
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,620

    Re: How to show File menu

    Quote Originally Posted by robertpantangco View Post
    I have tried CMenu *pMenu=AfxGetMainWnd()->GetMenu();
    but this does not display the menu at all.
    Of course it doesn't. GetMenu just returns menu object to let you start working with the one. To show its Files submenu you need to call GetSubMenu (File menu has 0 index) and then TrackPopupMenu for the obtained submenu object.
    Best regards,
    Igor

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured