Re: WinPopupMenu using WinCreateWindow + WC_MENU
- From: Marty <net@xxxxxxxxxxxxxxxxxxx>
- Date: Tue, 03 Jun 2008 09:32:37 -0700
lpino wrote:
Ok, I left behind the creation problems and now I have another
problem. The popup, doesn't stay, it just goes away right away. In
fact maybe I never had a creation problem but the thing was so fast I
didn't see it coming on.
I have checked the Windows implementation and there is a difference in
the way the APIs react. The windows API doesn't return immediately
like WinPopupMenu does. I checked wxWindows implementation under OS/2
and they go into a loop inside WM_CONTEXTMENU until they recieve the
command (clicking on the menu.. I guess). I tried that but I get into
an infinite loop (expected), but there is no popup (unexpected).
Any ideas?
Unless the loop is processing window messages, this is quite expected. Your PM thread can only execute in one location at a time. It can't pre-empt itself. (This is why the 1/10th second rule exists for message processing.)
If you're going to create a loop, make a WinGetMsg/WinDispatchMsg loop which quits after it dispatches a WM_COMMAND to your menu. But I'd recommend just letting the window procedure return after popping up the menu and processing WM_COMMAND to dismiss the menu in a separate call to your window procedure. Or better yet, make use of WM_MENUEND.
--
[Reverse the parts of the e-mail address to reply.]
.
- Follow-Ups:
- Re: WinPopupMenu using WinCreateWindow + WC_MENU
- From: lpino
- Re: WinPopupMenu using WinCreateWindow + WC_MENU
- References:
- Re: WinPopupMenu using WinCreateWindow + WC_MENU
- From: lpino
- Re: WinPopupMenu using WinCreateWindow + WC_MENU
- Prev by Date: Re: WinPopupMenu using WinCreateWindow + WC_MENU
- Next by Date: Re: WinPopupMenu using WinCreateWindow + WC_MENU
- Previous by thread: Re: WinPopupMenu using WinCreateWindow + WC_MENU
- Next by thread: Re: WinPopupMenu using WinCreateWindow + WC_MENU
- Index(es):
Relevant Pages
|
Loading