Solved

WebBrowser- using the Find command

Posted on 1998-08-31
6
179 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

815 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

11 Experts available now in Live!

Get 1:1 Help Now