In the original, when destroying the menu, occasionally it would get a message and never dispatch it. (In the case where GetMessage returned true, but m_hWnd had been destroyed).
Pretty tiny problem, but for the desired functionality, the message loop should be changed to:
// go into a modal loop
Anyway, big thanks to the author
There are a couple of problems when it is taken to dropdown button menu:
1) menu self closing during navigation
2) self hunging at GetMessage loop
For detailed information contact me (for free, of course, :-) ) and I'll send changed source or publish it (FlatPopupMenu.cpp, FlatPopupMenu.h)
Your sample was so Cool, solved my problem.
I have got a question(could be simple to U,think so)
got several classes(actually Dialog box as CFormView as base class), need to display them when mouse is clicked.
I'm wondering 'coz dialog class derived from CFormView doesn't have 'doModal' as like the classes derived from CDialog.
Hope im'not troubling you.
//and that should do it.. no flickering no nothing.
Im not sure if it requires ie for it to work,
there is nothing in the msdn documentation to suggest it would.
This solution is probably more "prettier" than the other solution i posted on to this web site.
There is of course still the problem the inactual fact the menu DOES take the focus away, and this fix, only fixes the visual aspect, there is still the need to "foward" messages on to the window in the background.
This is what i plan on working on next, and should hope to have a solution posted here in the next few days.
can u help in handleing runtime menus. i was able to generate menus during runtime but i donot know how to handle
my requirement is i have a candidate table he has a status as Accepted or Rejected. on right click i am fetching these status from the database table called status and creating the popup menu for it. but i am not able to handle them.
but, and I have to say but... it's crashing, sometimes...
here's an example, i used this on a separate dll of a modal dialog, and... the first time i load up the dll, and popup the menu, all very nice... i can do everything i want... i close the modal dialog (and the dll), and reopen it again... and once again, i popup the menu... surprise of surprises... my applications terminates... puff!! gone... got an explanation for this?