Solved

Get Selected menu item from DIalog based app

Posted on 2001-09-06
7
322 Views
Last Modified: 2013-11-20
How can I get selected item in dialog menu from dialog based app ?
0
Comment
Question by:monster2
7 Comments
 
LVL 9

Accepted Solution

by:
Pacman earned 100 total points
ID: 6460804
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
 
LVL 4

Expert Comment

by:jtwine100697
ID: 6460840
Since Dialog apps tend to not have a menu bar, how did you add the menu to the dialog?

-=- James.
0
 
LVL 4

Expert Comment

by:jtwine100697
ID: 6460857
(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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Expert Comment

by:BogdyPtr
ID: 6460878
U write a command handler for UPDATE_COMMAND_UI.
0
 

Author Comment

by:monster2
ID: 6460923
G R E A T !!!
Thanks
0
 
LVL 4

Expert Comment

by:jtwine100697
ID: 6461006
> 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
 

Author Comment

by:monster2
ID: 6461095

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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Include multiple hostnames in this command? 3 55
Expand macro to ask for filename column 8 37
matchUp  challenge 9 126
Work with App store 7 96
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question