tags:

views:

98

answers:

2

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?

+3  A: 

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.

Greg Hewgill
The WM_CONTEXTMENU message is what you should use, not WM_COMMAND or WM_LBUTTONDOWN.
Stefan
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 Hewgill
Greg, thnx for reply.WM_COMMAND is not giving any notification when i click on menu/submenu.Please help.
Vishal
I can't suggest any more than I already have unless you post some of your source code.
Greg Hewgill
A: 

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

Thnx ginger.But WM_MENUSELECT is not working while clicking on menu/submenu.
Vishal
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 http://msdn.microsoft.com/en-us/library/ms646352(VS.85).aspxdo not work for you (even thought it works for others)I can't help you more :))