Article View: borland.public.cppbuilder.nativeapi
Article #307Re: Canceling a popup event
From: Marc
Date: Thu, 05 Jun 2008 06:04
Date: Thu, 05 Jun 2008 06:04
43 lines
2295 bytes
2295 bytes
Thanks, everything is working now.
Rds
Marc
"Remy Lebeau (TeamB)" <no.spam@no.spam.com> schrieb im Newsbeitrag
news:4846e512$1@newsgroups.borland.com...
>
> "Marc" <info@mawnet.com> wrote in message
> news:48468254$1@newsgroups.borland.com...
>
>> case WM_RBUTTONDOWN:
>> TPoint PopupPoint;
>> GetCursorPos(&PopupPoint);
>> PopupMenu->Popup(PopupPoint.x,PopupPoint.y);
>
> There is a well-known bug in the OS that causes such code to not dismiss
> the menu correctly if the user clicks outside the menu without selecting
> an item. To workaround that bug, you have to use this code instead:
>
> case WM_RBUTTONDOWN:
> {
> TPoint PopupPoint;
> GetCursorPos(&PopupPoint);
> SetForegroundWindow(Handle); // <-- add this
> PopupMenu->Popup(PopupPoint.x,PopupPoint.y);
> PostMessage(Handle, WM_NULL, 0, 0); // <-- add this
> break;
> }
>
>> But sometimes the user does not want to select an item, but just
>> check which options are available.
>> How can I close the popup again WITHOUT the user clicking an option ?
>
> The user has to click somewhere outside the menu (once the above fix is in
> place).
>
>
> Gambit
>
Technical Details
Message-ID:
<48478231@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!feeder3.cambrium.nl!feed.tweaknews.nl!newsfeed0.kamp.net!newsfeed.kamp.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<48468254$1@newsgroups.borland.com> <4846e512$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,5cc04c471f3ad2ba X-Google-Attributes: gid10cc67,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Reply-To: "Marc" <info@mawnet.com> From: "Marc" <info@mawnet.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <48468254$1@newsgroups.borland.com> <4846e512$1@newsgroups.borland.com> Subject: Re: Canceling a popup event Date: Thu, 5 Jun 2008 08:04:07 +0200 Lines: 45 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512 X-RFC2646: Format=Flowed; Response NNTP-Posting-Host: 83.76.32.119 Message-ID: <48478231@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1212645937 83.76.32.119 (4 Jun 2008 23:05:37 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!feeder3.cambrium.nl!feed.tweaknews.nl!newsfeed0.kamp.net!newsfeed.kamp.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail