Tech Support > Microsoft Windows > Development Resources > Re: TrackPopupMenu not working (context menu for a menu item)
Re: TrackPopupMenu not working (context menu for a menu item)
Posted by Elias Fotinis on July 26th, 2003


Dark wrote:
Like Tim said, I don't think you can have two separate menus active at
the same time.

Every menu in Windows that has a right-click submenu is actually a
special window of class "BaseBar" (or "MenuSite"; I don't remember
exactly). So, I believe we have to implement our own special "menus" to
do this.


Posted by Tim on July 27th, 2003


Normally, if you use menus as they are designed and intended to be used, you
do not have to do any of this EG processing WM_MENURBUTTONUP as the menu
system itself handles this message.
It seems to me that you may be complicating things expecting them to be
complex.

If you have a context menu, then assemble the entire context menu before
calling Track... you won't then need to know anything about what goes on
while the menu is active. Similarly for resouce based menus EG the main menu
bar, modify the menu during the WM_INITMENU message and add / remove any
menu items you need to customise it before it is show.

In general it is regarded as not nice to have such context sensitive menus -
eg as per the Project Properties in VS.Net - the user will find it difficult
to learn when and why the various menu items appear and disappear. It is not
intuitive. Be careful to detail the whens and whys in online help. Consider
using the Enable / Disable methods and have all the options in the context
menu all the time - it is then an easy read for the user to see 'when I
right click on an object in state x this happens'.

- Tim


"Dark" <oceandark7@netscape.net> wrote in message
news:242f7055.0307261802.695c939@posting.google.co m...



Similar Posts