🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Show Find dialog in TCppWebBrowser

#1344
From: Albert Wiersch
Date: Wed, 23 Feb 2005 16:07
57 lines
2612 bytes
Thank you all. I was able to construct something that actually works. :-)

Here it is:

#include <mshtmhst.h>

void __fastcall TCSEQEForm::WBOptionsFindClick(TObject *Sender) {
 if( (WB) && (WB->Document) && 
(WB->ReadyState==Shdocvw_tlb::READYSTATE_COMPLETE) ) {
  TComInterface<IOleCommandTarget> CmdTarget;
  if 
(SUCCEEDED(WB->Document->QueryInterface(IID_IOleCommandTarget,(LPVOID*)&CmdTarget)) 
 )
   CmdTarget->Exec(&CGID_WebBrowser, HTMLID_FIND, 0, NULL, NULL);
   CmdTarget->Release();
 }
}

-- 
Albert Wiersch
http://www.htmlvalidator.com/


"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message 
news:421c5106$1@newsgroups.borland.com...
>
> "Albert Wiersch" <mrinternetnewsborland@wiersch.com> wrote in message
> news:421be1c2$1@newsgroups.borland.com...
>
>> Just found this. If I can translate it to CPP I think it should work:
>> http://members.shaw.ca/iedelphi/webbrowser.htm#advanced2
>
>    #include <utilcls.h>
>
>    const DWORD HTMLID_FIND = 1;
>    const GUID CGID_WebBrowser = {0xED016940, 0xBD5B, 0x11CF, {0xBA, 0x4E,
> 0x00, 0xC0, 0x4F, 0xD7, 0x08, 0x16}};
>
>    void __fastcall TForm1::FindIE()
>    {
>        if( (WebBrowser1->Document) && (WebBrowser->ReadyState ==
> READYSTATE_COMPLETE) )
>        {
>            TComInterface<IOleCommandTarget> CmdTarget;
>            if(
> SUCCEEDED(WebBrowser1->Document->QueryInterface(IID_IOleCommandTarget,
> (LPVOID*)&CmdTarget)) )
>                CmdTarget->Exec(&CGID_WebBrowser, HTMLID_FIND, 0, NULL,
> NULL);
>        }
>    }
>
>
> Gambit
>
> 
Technical Details
Message-ID: <421caa1a$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!gatel-ffm!gatel-ffm!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <421bcfa2$1@newsgroups.borland.com> <421bd738$1@newsgroups.borland.com> <421be1c2$1@newsgroups.borland.com> <421c5106$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,767b6514a77617a0
X-Google-Attributes: gidfeeec,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Albert Wiersch" <mrinternetnewsborland@wiersch.com>
Newsgroups: borland.public.cppbuilder.internet.web
References: <421bcfa2$1@newsgroups.borland.com> <421bd738$1@newsgroups.borland.com> <421be1c2$1@newsgroups.borland.com> <421c5106$1@newsgroups.borland.com>
Subject: Re: Show Find dialog in TCppWebBrowser
Date: Wed, 23 Feb 2005 10:07:24 -0600
Lines: 59
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 70.244.73.182
Message-ID: <421caa1a$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1109174810 70.244.73.182 (23 Feb 2005 08:06:50 -0800)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!gatel-ffm!gatel-ffm!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail