Solved

Deleting owner window of popup menu when popup menu is displayed

Posted on 1997-11-26
1
469 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

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…
If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

746 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

11 Experts available now in Live!

Get 1:1 Help Now