Solved

WebBrowser- using the Find command

Posted on 1998-08-31
6
178 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi 10 Seattle Dataset Actions 5 78
How to use Hashing sha1 in Delphi 2010 4 198
error 1.1 400 Bad request idhttp delphi 18 52
Working with hours 3 45
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

932 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

14 Experts available now in Live!

Get 1:1 Help Now