Solved

How to find the parent menu of a popup menu?

Posted on 1998-01-11
3
651 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

749 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