Autor Beitrag
CABALxx
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 174


D7 Ent
BeitragVerfasst: Di 10.02.04 20:11 
alsooo ich mal wieder *gg*

ich hab mal wieder eine frage

also....
wie macht man das, das ein programm automatisch eine im TWebBrowser angezeigte seite nach einem bestimmten wort durchsucht?
z.B. wenn ich mit WebBrowser in einem chat bin und jemand hat "hallo" geschrieben dann soll das programm das wort "hallo" suchen und wenns jemand geschrieben hat irgenwas machen
am besten mit Boolean
so irgendwie

ausblenden Delphi-Quelltext
1:
2:
3:
4:
if
Programm sucht 'hallo' := True
then
tu das und das


ich hoff man versteht was ich meine
ich möchte praktisch ein programm um im TWebBrowser nach einzelnen wörtern zu suchen...

thx schonmal im vorraus
tüftel schon recht lange erfolglos daran :oops:


Zuletzt bearbeitet von CABALxx am Di 02.03.04 19:59, insgesamt 1-mal bearbeitet
ixtreme
Gast
Erhaltene Danke: 1



BeitragVerfasst: Di 10.02.04 20:19 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
{....}

  private
    procedure SearchAndHighlightText(aText: string);
    
{....}

procedure TForm1.SearchAndHighlightText(aText: string);
var
  i: Integer;
begin
  for i := 0 to WebBrowser1.OleObject.Document.All.Length - 1 do
  begin
    if Pos(aText, WebBrowser1.OleObject.Document.All.Item(i).InnerText) <> 0 then
    begin
      WebBrowser1.OleObject.Document.All.Item(i).Style.Color := '#FFFF00';
      WebBrowser1.OleObject.Document.All.Item(i).ScrollIntoView(True);
    end;
  end;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  SearchAndHighlightText('some text...');
end;


Gruß

ixtreme.de
CABALxx Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 174


D7 Ent
BeitragVerfasst: Di 10.02.04 21:40 
thx schonmal :)

aber den code kenn ich
das tutorial oder diesen tipp wo der drin steht hab ich auch gefunden
nur is das problem
bei ner ganz einfachen seite
funktioniert der wunderbar
nur sobald die seite frames hat
funktioniert der nicht mehr und da liegt das problem
weil ich mit ner frameseite arbeite....
ich hab schon versucht den auf frames umzuschreiben aber das hat nicht wirklich funktioniert......

vielleicht ne idee :?:
CABALxx Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 174


D7 Ent
BeitragVerfasst: Fr 13.02.04 13:36 
keiner eine idee wie man den obigen code auf frames umschreiben könnte? oder ne andere idee oder so :(

EDIT////

hat sich erledigt :D

vieln dank nochmals