Solved

WebBrowser- using the Find command

Posted on 1998-08-31
6
177 Views
Last Modified: 2010-04-04
I am using the WebBrowser. How can I implement the Find command to find a string in the web page ?
0
Comment
Question by:yvess
  • 3
  • 2
6 Comments
 
LVL 10

Expert Comment

by:viktornet
ID: 1338190
I tried looking for WebBrowser in my component's pallette, but couldn't find it. Is it a 3d party component???
Anyway, can't you use
Is there a text-like in that component..like WebBrowser.Text or something similar.???
if Pos('Something', WebBrowser.text) > 0 then
  ShowMessage('Found');

Regards,
Viktor Ivanov
0
 

Author Comment

by:yvess
ID: 1338191
WebBrowser is MS ActiveX component that allows you to implement a Web browser such as IE4.  You have to import the component by going to import active X in the menu.

There is a method attach to this component but it is not obvious how to implement it. I am looking for some example on how to implement that in Delphi.
0
 
LVL 7

Accepted Solution

by:
BlackMan earned 120 total points
ID: 1338192
const
  HTMLID_FIND       = 1;
  HTMLID_VIEWSOURCE = 2;
  HTMLID_OPTIONS    = 3;


procedure TMainForm.mnuEditFindClick(Sender: TObject);
begin
InvokeIE(HTMLID_FIND);
end;


procedure TMainForm.InvokeIE(Value: Integer);
const
CGID_WebBrowser: TGUID = '{ED016940-BD5B-11cf-BA4E-00C04FD70816}';
var
  CmdTarget : IOleCommandTarget;
  vaIn, vaOut: OleVariant;
  PtrGUID: PGUID;
begin
New(PtrGUID);
  PtrGUID^ := CGID_WebBrowser;
  if WebBrowser1.Document <> nil then
   try
     WebBrowser1.Document.QueryInterface(IOleCommandTarget, CmdTarget);
     if CmdTarget <> nil then
      try
         CmdTarget.Exec( PtrGUID, Value, 0, vaIn, vaOut);
       finally
         CmdTarget._Release;
       end;
   except
    // Nothing
    end;
  Dispose(PtrGUID);
end;

0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:yvess
ID: 1338193
Thank you BlackMan. Do you know of any way to do this but using my own dialog ?  I am writing a multilingual application and it would be easier that way.

Thank you.
0
 
LVL 7

Expert Comment

by:BlackMan
ID: 1338194
No, unfortunately not..
0
 

Author Comment

by:yvess
ID: 1338195
Thank you.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now