-
July 23rd, 2001, 02:46 AM
#1
EnableMenuItem
I've got another problem thats got me stumped.
I've got a dialog app with a popup menu in the system tray. I want to disable items in the menu but every method I've tried doesn't work.
This is what I've tried last and it doesn't work.
CMenu m_Menu, *pSubMenu;
m_Menu.LoadMenu(IDR_POPUP_MENU);
pSubMenu = m_Menu.GetSubMenu(0);
pSubMenu->EnableMenuItem(ID_POPUP_ABOUT, MF_BYCOMMAND | MF_GRAYED);
Thanks.
Dan.
-
July 23rd, 2001, 03:02 AM
#2
Re: EnableMenuItem
you need to override CWnd::OnInitMenuPopup
Hope this helps
Eugene Gill
Please take the time to rate this answer if you found it useful. It will make me a happy man!
-
July 23rd, 2001, 03:49 AM
#3
Re: EnableMenuItem
I had a quick look but couldn't find it. Is it available to a dialog app? My app doesn't have a main frame.
Thanks.
Dan.
-
July 23rd, 2001, 04:30 AM
#4
Re: EnableMenuItem
Add a handler for WM_INITMENUPOPUP in you dialog. To do this through class wizard you will need to go to the class info tab and change the message filter from Dialog to Window.
Hope this helps
Eugene Gill
Please take the time to rate this answer if you found it useful. It will make me a happy man!
-
July 23rd, 2001, 04:50 AM
#5
Re: EnableMenuItem
I gave that a go but it still doesn't work.
I used the info on this page http://www.codeguru.com/mfc/comments/16665.shtml
I'm sure I'm doing something wrong.
Dan.
-
July 23rd, 2001, 04:52 AM
#6
Re: EnableMenuItem
I'd like to help but I have to go out now. Post your code for WM_INITMENUPOPUP for others to see.
Hope this helps
Eugene Gill
Please take the time to rate this answer if you found it useful. It will make me a happy man!
-
July 23rd, 2001, 05:15 AM
#7
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
|