🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.web
Article #474

CppWebBrowser OnNewWindow2 event handling

#474
From: Mark Jacobs
Date: Sun, 07 Jan 2007 22:01
19 lines
1551 bytes
I have the following code to handle "pop-ups" and valid new window launches 
inside CppWebBrowser's OnNewWindow2 event :-

//---------------------------------------------------------------------------
void __fastcall TForm1::CppWebBrowser1NewWindow2(TObject *Sender,LPDISPATCH 
*ppDisp,TOLEBOOL *Cancel)
{
  *Cancel=true;
  if (CppWebBrowser1->ReadyState<3) { ppDisp=NULL; return;}
  // Some code to launch the URL in a new window...
}
//---------------------------------------------------------------------------

The problem I am having is deriving the URL that will be launched, if I do 
allow the pop-up. How do I derive this from the arguments handed to the 
event handler?
-- 
Mark Jacobs
www.jacobsm.com 
Technical Details
Message-ID: <45a16d9f$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.germany.com!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,3b7f79a773c6cfb8,start
X-Google-Attributes: gidfeeec,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Mark Jacobs" <mark@jacobsm.com>
Newsgroups: borland.public.cppbuilder.internet.web
Subject: CppWebBrowser OnNewWindow2 event handling
Date: Sun, 7 Jan 2007 22:01:56 -0000
Lines: 21
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 195.137.123.182
Message-ID: <45a16d9f$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1168207263 195.137.123.182 (7 Jan 2007 14:01:03 -0800)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.germany.com!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail