I created a menu in a dialog using CMenu.
When we click a button or the mouse over a button in the menu, the submenu will appear.
Then how can i know the submenu is appeared and close the appeared submenu in my dialog.
Printable View
I created a menu in a dialog using CMenu.
When we click a button or the mouse over a button in the menu, the submenu will appear.
Then how can i know the submenu is appeared and close the appeared submenu in my dialog.
Can I ask why you are putting a menu in a dialog?
Hi,
Use the TrackPopupMenu function to display your popupmenu, If you use it with the TPM_RETURNCMD flag you will be able to say if the user has select a commands or press Cancel.
Note that TrackPopupMenu returns only when the menu is no more displayed (Cancel of the user or selection of command).
Sorry,
I do not read correctly the topic.
try to handle the WM_INITMENUPOPUP in your dialog.
It will contain the handle of the menu or submenu displayed.