Autor Beitrag
tc4xe
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 55



BeitragVerfasst: Mo 30.04.07 19:01 
Jungs, ich habe ein Problem und komme nicht weiter...
Ich will ersteinmal die Webseite als Bsp: beipsiel.abc/formular.php im WebBrowser laden und nachdem alles geladen wurde einen Textfeld ausfüllen und dies abschicken.
Ich glaube der Code an sich ist richtig ..
Wenn ich das Programm starte sehe ich meine Form1 garnicht und bei der CPU Auslastung im Taskmanager steht 90-99 %
Wenn ich es so mache dass ich manuel Klicke gehts aber, bitte um Hilfe!

Hier mein Code:

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:
26:
27:
28:
29:
var
  Form1: TForm1;
  i:integer;
  geladen:boolean=false;

implementation

{$R *.dfm}

procedure TForm1.WebBrowser1DocumentComplete(Sender: TObject;
  const pDisp: IDispatch; var URL: OleVariant);
begin
geladen:=true;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
Webbrowser1.Navigate('http://beipsiel.abc/formular.php');
repeat
Application.ProcessMessages;
Sleep(100);
until geladen=true; Button1.Click;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
WebBrowser1.OleObject.document.forms.item(0).elements.item('yourmessage').value:='HIER!! Mein Text';
WebBrowser1.OleObject.document.forms.item(0).submit;  // Daten an Server senden
end;


Moderiert von user profile iconTino: "BITTE UM HILFE!" aus dem Titel entfernt.
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Mo 30.04.07 19:03 
Wieso schreibste nicht einfach in das OnDocumentComplete das Button1Click?

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10183
Erhaltene Danke: 1256

W10ent
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Mo 30.04.07 22:24 
Moin!

user profile icontc4xe hat folgendes geschrieben:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
//...
procedure TForm1.WebBrowser1DocumentComplete(Sender: TObject; const pDisp: IDispatch; var URL: OleVariant);
begin
  geladen:=true;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Webbrowser1.Navigate('http://beipsiel.abc/formular.php');
  repeat
    Application.ProcessMessages;
    Sleep(100);
  until geladen=true; 

  Button1.Click;
end;
//...

:shock: :hair:

Darf ich dir das hier mal ans Herz legen... :? :les: :idea: ;)

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.