Solved

Get Selected menu item from DIalog based app

Posted on 2001-09-06
7
320 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Excel Use VBA to get user's Mac Address for their computer 5 174
sum67 challenge 35 99
Problem to App 4 83
Increment column based of a FK 8 23
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
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.

809 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