Autor Beitrag
CodeRed
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 45

Win 2000
D7 Pers
BeitragVerfasst: Di 26.04.05 16:05 
hi!
Hab mal wieder ein Problem:
Und zwar hab ich ein kleines Tool, das im Hintergrund läuft und dort immer wieder eine bestimmte Seite aufruft.
Das Fenster wird durch "Application.ShowMainForm := False" verborgen. Die Prozedur wird durch einen Timer aufgerufen.
Nun surft er auch auf die Seite, bleibt dann jedoch so lange an "while webbrowser1.readystyle <> readystyle_complete do application.processmessages" hängen, bis ich die MainForm anzeigen lasse. erst dann gilt für ihn die seite als geladen.
habt ihr ne idee, an was das liegen könnte??
MfG und Thx gleich mal!
CodeRed
CodeRed Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 45

Win 2000
D7 Pers
BeitragVerfasst: Do 28.04.05 20:27 
so, hab nun nochmal etwas rum probiert und bin mir nun ziemlich sicher, dass es nicht am Timer liegt.

aber habt ihr ne idee, an was es dann liegen könnte??

MfG
CodeRed
toms
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1099
Erhaltene Danke: 2



BeitragVerfasst: Mo 02.05.05 06:43 
Hallo!

Ich kann dein Problem bei mir nicht reproduzieren.
Ein kleines Demo Projekt (als Anlage) waere darum mehr als hilfreich.
CodeRed Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 45

Win 2000
D7 Pers
BeitragVerfasst: Di 03.05.05 19:59 
ich hoffe das reicht... wenn nicht, dann sagt bescheid, was ihr noch braucht.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
procedure TForm1.FormCreate(Sender: TObject);
begin
  Application.ShowMainForm := False;
  surfen
end;

procedure TForm1.surfen;
begin
  ShowMessage('Davor');
  Webbrowser1.Navigate('http://www.google.de');
  while Webbrowser1.ReadyState <> READYSTATE_COMPLETE do
    Application.ProcessMessages;
  ShowMessage('OK');
end;


Es wird mir hier noch die Meldung "davor" gezeigt, dann seh ich an der Internetleitung, dass er die Seite lädt, doch dann bleibt er an dem ReadyState hängen.
Wenn ich nun aber während er an diesem Readystate hängt die Form wieder sichtbar mache (SystemTrayIcon), so bekomme ich dann auch die Meldung "OK".
das ganze funktioniert also nur dann nicht, wenn das Programm nicht sichbar ist

naja, vielleicht könnt ihr mir ja helfen!!
MfG
CodeRed

Moderiert von user profile iconraziel: Code- durch Delphi-Tags ersetzt.
Robinator
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 275

WinXP
BDS 2006
BeitragVerfasst: Di 17.05.05 21:23 
Hi...

Der Webbrowser muss mindestens einmal Sichtbar gewesen sein, damit er ein handle bekommt (Wenn ich da richtin informiert bin) umgehen kannst du das mit Mywebbrowser.handleneeded;

mfg RoB
CodeRed Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 45

Win 2000
D7 Pers
BeitragVerfasst: Mi 18.05.05 14:25 
jawoll, vielen dank!! es funktioniert!!!!

super!!