Get Selected menu item from DIalog based app

How can I get selected item in dialog menu from dialog based app ?
monster2Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
PacmanConnect With a Mentor Commented:
you just write a command-handler for this item.
go to class wizard, choose your dialog class and add message handler for windows. select id of the menu item and add function.
0
 
jtwine100697Commented:
Since Dialog apps tend to not have a menu bar, how did you add the menu to the dialog?

-=- James.
0
 
jtwine100697Commented:
(Sorry, comitted the comment too soon)

If you used the "standard" CWnd::SetMenu(...) to create the menubar for the dialog, then the standard MFC command routing (which Pacman suggested above) will work.

-=- James.
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
BogdyPtrCommented:
U write a command handler for UPDATE_COMMAND_UI.
0
 
monster2Author Commented:
G R E A T !!!
Thanks
0
 
jtwine100697Commented:
> U write a command handler for UPDATE_COMMAND_UI.

That is how you update an command item (like changing the text or checkmark of a menu item), not how you get the actual item selected (or trigger an action based on the item that was selected).

-=- James.
0
 
monster2Author Commented:

I set filter to window and choose WM_MENUSELECT
Then I got the
::OnMenuSelect(UINT nItemID, UINT nFlags, HMENU hSysMenu)
function where I used CMenu to attach on hSySMenu
After that all is simple play

Regards
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.