Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Deleting owner window of popup menu when popup menu is displayed

Posted on 1997-11-26
1
Medium Priority
?
488 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
[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
1 Comment
 
LVL 7

Accepted Solution

by:
galkin earned 600 total points
ID: 1408922
Send WM_CANCELMODE message to menu owner window before thos window is actually destroyed.
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

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…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

604 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