[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Status Bar text not updated with context menu

Posted on 2004-10-29
8
Medium Priority
?
255 Views
Last Modified: 2013-11-20
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?
Thanks
0
Comment
Question by:Nhl2k
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
8 Comments
 

Author Comment

by:Nhl2k
ID: 12462713
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.
0
 
LVL 19

Expert Comment

by:mrwad99
ID: 12470872
Ah yes; appologies.

I will try and find a way to do this later.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 19

Expert Comment

by:mrwad99
ID: 12503943
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.
0
 

Author Comment

by:Nhl2k
ID: 12504419
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.
0
 
LVL 19

Accepted Solution

by:
mrwad99 earned 200 total points
ID: 12504726
I have just created a simple MDI app that has a context menu; the status bar text is now updated fine !

See http://homepage.ntlworld.com/d.billingham/R/Test.zip

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

OnContextMenu(CWnd* pWnd, CPoint point)

not

OnRButtonUp(....)
0
 

Author Comment

by:Nhl2k
ID: 12506342
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!
0
 
LVL 19

Expert Comment

by:mrwad99
ID: 12507274
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 :)
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question