Solved

How to find the parent menu of a popup menu?

Posted on 1998-01-11
3
667 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

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: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

734 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