Status Bar text not updated with context menu

I have a MDI project that has a right-click context menu. I went to the properties of one of the menu items, and added some text in the prompt. When I right click and move my mouse over the menu item, the status bar isn't updated with the text from my menu item. I am loading my context menu in the OnRButtonUp function in my View class. I am assuming this is the expected behavior and I'll probably need to add some extra code to have my menu update the text on the status bar. Can someone help me understand where that text that I filled into the prompt field goes and how I can update my status bar with that text?
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

mrwad99Connect With a Mentor Commented:
I have just created a simple MDI app that has a context menu; the status bar text is now updated fine !


I think the problem lies in where you are invoking the menu; it should be in

OnContextMenu(CWnd* pWnd, CPoint point)


Nhl2kAuthor Commented:
This question deals with sending text to the status bar on a popup menu item. I am trying to get text on the status bar from a menu item that's in a context menu when I right click.
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Ah yes; appologies.

I will try and find a way to do this later.
Hi Nhl2k.

Sorry about the delay.  I have looked into this problem a little more, and found that you can get the status bar text to appear if the items in the context menu are also in the main application menu.  For example, you could have the option to create a new window in your context menu and also in the File menu; if both menus have the same ID (eg ID_CREATE_NEW_WINDOW) then the text specified as the prompt for the top level menu will also appear in that for the context menu.  However, adding a new item to the context menu that is not in the top level menu still refuses to show the status bar text.  This is annoying, and I will look into this even further as I cannot see why it should refuse to work.

Hope this update is of use; feel free to close this question you want.
Nhl2kAuthor Commented:
No problem. I'll leave the question open for a while and if you don't think you have an answer, just let me know and I'll close the question. I found it annoying too and it made me wonder how other applications do it. Even in Internet Explorer, if you right click and move your mouse over an item, it shows the status bar text, and I don't see why it's so hard to find documentation on this subject.
Nhl2kAuthor Commented:
Actually, you helped me solve the problem but it wasn't because the menu wasn't in the OnContextMenu function. For some reason, the book I am referencing passed the "this" pointer in the view class as the pWnd parameter to the TrackPopupMenu function, when I needed to use AfxGetApp()->m_pMainWnd to get the main window's pointer. I guess I should have posted the code I had for loading the menu but I didn't think that was the problem.
Thanks for the help!
Ah right, I had that problem too.  I think in the source code I referred to the question on EE that got me sorted; it is
http:Q_20285802.html for future reference.

Glad to help overall :)
All Courses

From novice to tech pro — start learning today.