Sign in to follow this  

Win32 menu question

This topic is 3460 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey everyone :) I am hoping this is an easy question.. I am looking for a way so that I can update my main windows' status bar whenever the mouse cursor is over a menu item. Unfortunately, I am not finding anything via Google nor MSDN (Perhaps I am using the wrong words..?) on how I might be able to do this. Does anyone know how to get the menu item that the mouse cursor is over? I know there is a way I just cant seem to find it.. :( I know about receiving messages when menu items are clicked but want to see if there is a way to check if menu items are highlighted (Mouse is over it). Its using C++ with the native win32 API. Thanks for any help :)

Share this post


Link to post
Share on other sites
Have you looked into WM_NCMOUSEMOVE and WM_NCHITTEST with an eye towards HTMENU? You might need to cross reference the x,y position of the cursor against the position of the menu items using old school menu commands.

Wait - I found it...

Messages Used with Menus

Quote:

Each time the user moves the highlighting from one item to another, the system sends a WM_MENUSELECT message to the window procedure of the menu's owner window. This message identifies the currently selected menu item. Many applications provide an information area at the bottom of their main windows and use this message to display additional information about the selected menu item.



Share this post


Link to post
Share on other sites
Aha! That seems to be it! WM_MENUSELECT is listed under user input->keyboard accelerators instead of the menu messages in MSDN... Weird :/

Thanks for the help! [smile]

Share this post


Link to post
Share on other sites

This topic is 3460 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this