-
March 14th, 2013, 06:50 PM
#1
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...
-
March 15th, 2013, 04:36 AM
#2
Re: How to show File menu
Originally Posted by robertpantangco
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
-
March 16th, 2013, 01:24 PM
#3
Re: How to show File menu
Originally Posted by robertpantangco
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|