Click to See Complete Forum and Search --> : Popup Menu.
Bill Baker
April 15th, 1999, 07:53 AM
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
Robert Bielik
April 16th, 1999, 02:37 AM
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
Bill Baker
April 16th, 1999, 07:33 AM
Thanks for the reply.
I've tried both solutions, however TrackPopupMenu captures the mouse! Thus the main window no longer recieves mouse messages.
Jason Teagle
April 16th, 1999, 07:45 AM
In that case, how about trying to derive a class from CMenu that handles this mouse movement code?
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.