Solved

Deleting owner window of popup menu when popup menu is displayed

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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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…
zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

777 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