0

I am trying to get menu/submenu name on mouse left click.For this i need to get some notification when i click on that particular menu/submenu.Look if somebody has the idea to do that?

2
  • 1
    Could you eleborate more details?, for example, the codes you trying now, more detail explanations about your problem. Commented Dec 11, 2009 at 10:01
  • I am trying to get menu/submenu name on mouse left click.For this i need to get some notification when i click on that particular menu/submenu.GetMenuItemInfo gives menu/submenu name if i pass menu index into that.Can you please help? Commented Dec 18, 2009 at 7:48

2 Answers 2

3

Instead of reacting to WM_LBUTTONDOWN for a menu, you should instead listen for the WM_COMMAND notification. Windows takes care of all the details of handling mouse movement and clicks within menus.

Sign up to request clarification or add additional context in comments.

4 Comments

The WM_CONTEXTMENU message is what you should use, not WM_COMMAND or WM_LBUTTONDOWN.
The WM_CONTEXTMENU notification is for a right click (or Shift+F10 or the context menu key), not for a left click as the original question requested.
Greg, thnx for reply.WM_COMMAND is not giving any notification when i click on menu/submenu.Please help.
I can't suggest any more than I already have unless you post some of your source code.
0

To work with menu/submenu there is a totally different WMs is Look in MSDN for this WM_MENUSELECT for example

2 Comments

Thnx ginger.But WM_MENUSELECT is not working while clicking on menu/submenu.
Sorry dude, but if this ""The WM_MENUSELECT message is sent to a menu's owner window when the user selects a menu item."" from msdn.microsoft.com/en-us/library/ms646352(VS.85).aspx do not work for you (even thought it works for others) I can't help you more :))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.