AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

IE: Felder ausfüllen

Ein Thema von synex · begonnen am 17. Mai 2003 · letzter Beitrag vom 20. Mai 2003
 
Benutzerbild von toms
toms
(CodeLib-Manager)

Registriert seit: 10. Jun 2002
4.648 Beiträge
 
Delphi XE Professional
 
#2
  Alt 17. Mai 2003, 23:28
Zitat:
Mein Programm soll die laufenden IE-Instanzen auflisten
Kannst du über IShellWindows. Siehe .hier

Hier noch ein Codeschnippsel, welcher alle laufenden IE Instanzen
auflistet und dann über das IWebbrowser2 Interface die Items
eines Dokumentes auflistet, usw.

Code:
var
  ShellWindow: IShellWindows;
  WB: IWebbrowser2;
  spDisp: IDispatch;
  IDoc1: IHTMLDocument2;
  Document: Variant;
  i, k, m: Integer;
  ovElements: OleVariant;
begin
  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);
    if WB <> nil then
    begin
      WB.Document.QueryInterface(IHTMLDocument2, iDoc1);
      if iDoc1 <> nil then
      begin
        WB := ShellWindow.Item(k) as IWebbrowser2;
        Document := WB.Document;
          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 input fields found, try to fill them out
                if (ovElements.item(i).tagName = ...
                  (ovElements.item(i).type = ...
                  begin
                 
                    // ...
                  end;
              except
                // failed...
              end;
            end; { for i...}
          end; { for m }
      end; { idoc <> nil }
    end; { wb <> nil }
    // ...
  end; { for k }
end;
Thomas
  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 08:50 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