🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #303

Canceling a popup event

#303
From: Marc
Date: Wed, 04 Jun 2008 11:53
37 lines
1835 bytes
Hi all


I use a
    NOTIFYICONDATA  tnd;
structure to display am icon on the Taskbar in WinXP.

The icon has a self declared message WM_SYSTRAYPOPUP as call back.
    tnd.uCallbackMessage = WM_SYSTRAYPOPUP;

The message is then caught by a message map
    VCL_MESSAGE_HANDLER(WM_SYSTRAYPOPUP , TMessage, WMSysTrayPopUp)

and sent to the following function:

void __fastcall TForm::WMSysTrayPopUp(TMessage& Msg)
{
 switch (Msg.LParamLo)
 {
      case WM_RBUTTONDOWN:
               TPoint PopupPoint;
               GetCursorPos(&PopupPoint);
               PopupMenu->Popup(PopupPoint.x,PopupPoint.y);
      break;
 }
}


So far so good, the popup opens and the options can be selected.

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 ?
EG when the user clicks somewhere outside the popup menu ?

Thanks and Regards
Marc
Technical Details
Message-ID: <48468254$1@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-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,5cc04c471f3ad2ba,start
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
Subject: Canceling a popup event
Date: Wed, 4 Jun 2008 13:53:52 +0200
Lines: 42
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; Original
NNTP-Posting-Host: 83.77.38.238
Message-ID: <48468254$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1212580436 83.77.38.238 (4 Jun 2008 04:53:56 -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