Article View: borland.public.cppbuilder.nativeapi
Article #305Re: Canceling a popup event
From: Mike Collins
Date: Wed, 04 Jun 2008 17:43
Date: Wed, 04 Jun 2008 17:43
29 lines
1863 bytes
1863 bytes
Don't know if this helps but...
I have a system tray app and i don't have that problem - i've just looked at
the code (though i don't remember writting it lol) and i have the following:
if (Message.Msg == WM_TRAYNOTIFY) <- this is the same as WM_SYSTRAYPOPUP
{
// Processes mouse events sent from the system tray
if (Message.LParam == WM_RBUTTONUP)
{
/* Find the mouse cursor and popup the popupmenu at that location.
The SetForegroundWindow
and PostMessage calls fix an OS bug that prevents the menu from
closing when the user
clicks outside the menu. KB article Q135788
*/
POINT WinPoint;
GetCursorPos(&WinPoint);
SetForegroundWindow(Handle);
popSysTray->Popup(WinPoint.x, WinPoint.y);
PostMessage(Handle, WM_NULL, 0, 0);
}
as the comment says, there appears to be a bug in the OS - this works
perfectly for me..
HTH
Mike C
Technical Details
Message-ID:
<4846c381@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!feeder.erje.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<48468254$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 From: "Mike Collins" <its@TheBottomOfThePost> Newsgroups: borland.public.cppbuilder.nativeapi References: <48468254$1@newsgroups.borland.com> Subject: Re: Canceling a popup event Date: Wed, 4 Jun 2008 17:43:12 -0000 Lines: 31 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.3790.3959 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.4133 X-RFC2646: Format=Flowed; Response NNTP-Posting-Host: 78.150.163.230 Message-ID: <4846c381@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1212597121 78.150.163.230 (4 Jun 2008 09:32:01 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!feeder.erje.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail