-
Popup Menu.
I'm looking for a way to destroy a popmenu after the mouse cursor has strayed away from the menu. An example of this behavior can be seen at MSNBC.com, when you mouse over a top menu item, a cascading menu popups up, now move the mouse away from the popup and after a second or two the popup menu disappears. MSNBC implements this in Java script code, is there away to get the same effect using WIN32?
thanks in advance
bill baker
-
Re: Popup Menu.
Problem here is to detect the mouse leaving the popup window, and then do the destruction. Check
TrackMouseEvent(...) function (only NT says the docs...)
Or maybe use SetCapture and in OnMouseMove check if you are outside the popup window, then ReleaseCapture and destroy menu...
/Rob
-
Re: Popup Menu.
Thanks for the reply.
I've tried both solutions, however TrackPopupMenu captures the mouse! Thus the main window no longer recieves mouse messages.
-
Re: Popup Menu.
In that case, how about trying to derive a class from CMenu that handles this mouse movement code?