AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Win32/Win64 API (native code) Delphi Welchen Class-Namen haben Edit-Boxen in Webbrowsern?
Thema durchsuchen
Ansicht
Themen-Optionen

Welchen Class-Namen haben Edit-Boxen in Webbrowsern?

Ein Thema von seddto1977 · begonnen am 9. Mai 2004 · letzter Beitrag vom 24. Aug 2005
 
seddto1977

Registriert seit: 15. Apr 2004
69 Beiträge
 
#3

Re: Welchen Class-Namen haben Edit-Boxen in Webbrowsern?

  Alt 12. Mai 2004, 09:31
So, hab mal im Forum gesucht und einen Codeschnipsel den ich gefunden hab, etwas modifiziert, leider gehts nicht

Code:
function GetString: Boolean;
type
  TIEFields = record
    tagName : String;
    fType : String;
  end;
const
  MaxIEFields = 2;
  IEFields: array[1..MaxIEFields] of TIEFields = (
    (tagName : 'INPUT'; fType : 'text'),
    (tagName : 'INPUT'; fType : 'password'));

var
  Mail: String;
  ShellWindow: IShellWindows;
  WB: IWebbrowser2;
  spDisp: IDispatch;
  IDoc1: IHTMLDocument2;
  Document: Variant;
  k, m: Integer;
  ovElements: OleVariant;
  i: Integer;
  IEFieldsCounter: Integer;
  IEFormName : array[1..MaxIEFields] Of String;
begin
  result := false;
  ShellWindow := CoShellWindows.Create;
  // get the running instance of Internet Explorer
  for k := 0 to ShellWindow.Count do
  begin
    spDisp := ShellWindow.Item(k);
    if spDisp = nil then Continue;
    // QueryInterface determines if an interface can be used with an object
    spDisp.QueryInterface(iWebBrowser2, WB);
    IEFieldsCounter := 0;
    if WB <> nil then
    begin
      WB.Document.QueryInterface(IHTMLDocument2, iDoc1);
      if iDoc1 <> nil then
      begin
        WB := ShellWindow.Item(k) as IWebbrowser2;
        Document := WB.Document;



          // count forms on document and iterate through its forms
          for m := 0 to Document.forms.Length - 1 do
          begin
            ovElements := Document.forms.Item(m).elements;

            // iterate through elements
            for i := ovElements.Length - 1 downto 0 do
            begin
              try

                    if Pos('@', ovElements.item(i).Value) > 0 then
                      begin
                        Mail := '<' +  ovElements.item(i).Value + '>';
                        String_Cut (Mail);
                        inc(IEFieldsCounter);

                      end;


              except
                // failed...
              end;
            end; { for i...}
          end; { for m }
      end; { idoc <> nil }
    end; { wb <> nil }

  end; { for k }
end;
Ich möchte damit einfach für meinen Mail-Clienten Email-Adressen aus Webformularen auslesen und dem user anbieten sie ins Adressbuch hinzuzufügen. Die function wird zwar komplett durchlaufen, allerdings findet sie nie etwas...Weiss jemand was ich falsch gemacht habe?
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 06:09 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz