Solved

Get Selected menu item from DIalog based app

Posted on 2001-09-06
7
319 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Expand to include initial dialog with two choices. 9 67
sum13 challenge 24 90
Fibonacci challenge 11 110
"Black Box" Testing of Control System Software 2 26
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

895 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now