[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 328
  • Last Modified:

Get Selected menu item from DIalog based app

How can I get selected item in dialog menu from dialog based app ?
0
monster2
Asked:
monster2
1 Solution
 
PacmanCommented:
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
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
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

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now