Solved

How to find the parent menu of a popup menu?

Posted on 1998-01-11
3
597 Views
Last Modified: 2013-11-20
Given the handle (or CMenu object) of a popup menu,
how can I get the handle (or CMenu object) of the
parent menu from which the given menu was popped?
0
Comment
Question by:mco
3 Comments
 
LVL 15

Expert Comment

by:Tommy Hui
ID: 1313783
I don't think it is possible because a popup menu does not necessarily have a parent menu.
0
 
LVL 1

Author Comment

by:mco
ID: 1313784
Well, you are right. But in those cases where the menu was popped
up as a submenu of another menu, the system knows about it.

0
 
LVL 7

Accepted Solution

by:
galkin earned 100 total points
ID: 1313785
It is not possible. What you actually can do if you now top menu handle( you can get it if you know menu owner window with GetMenu). Then you you can recursively enumerate all submenus each time comparing submenu handle with your menu handle. If there is match so this is parent menu.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

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.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

743 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

12 Experts available now in Live!

Get 1:1 Help Now