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?
-
1Could you eleborate more details?, for example, the codes you trying now, more detail explanations about your problem.YOU– YOU2009-12-11 10:01:53 +00:00Commented 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?Vishal– Vishal2009-12-18 07:48:54 +00:00Commented Dec 18, 2009 at 7:48
Add a comment
|
2 Answers
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.
4 Comments
Stefan
The WM_CONTEXTMENU message is what you should use, not WM_COMMAND or WM_LBUTTONDOWN.
Greg Hewgill
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.
Vishal
Greg, thnx for reply.WM_COMMAND is not giving any notification when i click on menu/submenu.Please help.
Greg Hewgill
I can't suggest any more than I already have unless you post some of your source code.
To work with menu/submenu there is a totally different WMs is Look in MSDN for this WM_MENUSELECT for example
2 Comments
Vishal
Thnx ginger.But WM_MENUSELECT is not working while clicking on menu/submenu.
user204724
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 :))