[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Get Selected menu item from DIalog based app

Posted on 2001-09-06
7
Medium Priority
?
327 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 400 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

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!

Question has a verified solution.

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

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

872 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