Solved

Deleting owner window of popup menu when popup menu is displayed

Posted on 1997-11-26
1
471 Views
Last Modified: 2013-12-03
I am using TrackPopupMenu to display a popup menu. When "inside" TrackPopupMenu, a timer is running (remember that a TrackPopupMenu has an internal message loop). The WM_TIMER event will cause me to destroy the window that I sent as owner window to TrackPopUpMenu. This will also cause a DestroyMenu of the popped up menu.
Amazingly, Windows will not hide the menu and if I click on a menuitem my application will crash.
How can I hide the menu before destroying it and thus overcome Win32's bug? I have heard of an undocumented "EndMenu" Win32 function but a look at User32.dll of win95 does not show me that function (NT's user32.dll does).
0
Comment
Question by:giltayar
1 Comment
 
LVL 7

Accepted Solution

by:
galkin earned 200 total points
ID: 1408922
Send WM_CANCELMODE message to menu owner window before thos window is actually destroyed.
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

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…

930 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

13 Experts available now in Live!

Get 1:1 Help Now