AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Win32/Win64 API (native code) Delphi Memo in anderem Programm auslesen
Thema durchsuchen
Ansicht
Themen-Optionen

Memo in anderem Programm auslesen

Ein Thema von Mirco · begonnen am 19. Jun 2006 · letzter Beitrag vom 22. Jun 2006
 
Mirco

Registriert seit: 6. Mai 2006
71 Beiträge
 
#3

Re: Memo in anderem Programm auslesen

  Alt 19. Jun 2006, 14:50
Hallo
Ich hab mal beim Internet Explorer folgendes gemacht um mich automatisch bei einem HTAcess Fenster einzuloggen:
Der Quelltext ist nicht von mir.
Delphi-Quellcode:
function TForm1.feld: boolean;
var
  ShellWindow: IShellWindows;
  WB: IWebbrowser2;
  spDisp: IDispatch;
  IDoc1: IHTMLDocument2;
  Document: Variant;
  k, m: Integer;
  ovElements: OleVariant;
  i: Integer;
begin
  result := false; //assume no go

  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 try

        WB.Document.QueryInterface(IHTMLDocument2, iDoc1);
      except
      end;
      if iDoc1 <> nil then
      begin
        WB := ShellWindow.Item(k) as IWebbrowser2;
        begin
          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 := 0 to ovElements.Length - 1 do
            begin
              // when input fieldname is found, try to fill out
              try
                if (CompareText(ovElements.item(i).tagName, 'INPUT') = 0) and
                  (CompareText(ovElements.item(i).type, 'text') = 0) then
                begin
                  ovElements.item(i).Value := 'username';
                end;
              except
              end;
                try
                if (CompareText(ovElements.item(i).tagName, 'INPUT') = 0) and
                  (CompareText(ovElements.item(i).type, 'SUBMIT') = 0) and
                  (ovElements.item(i).Value = 'weiter') then // Suchen für German
                begin
                  ovElements.item(i).Click;
                  result := true; // we're a go!

                end;
              except
              end;
            end;
          end;
        end;
      end;
    end;
  end;
end;
Die Anordnung meines Fensters in der anderen Anwendung sieht so aus:
Delphi-Quellcode:
786638: TDataForm "Data"
  786640: TPanel "Panel1"
    721098: TPanel
      983250: TMemo "TExt"
Ich bekomm den Quelltext oben nicht angepasst.
Grüsse
Mirco
Mirco Hallenga
  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 10:54 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