Autor Beitrag
adler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 511

Windows XP
Delphi 05 Pers
BeitragVerfasst: Fr 19.03.04 16:39 
Hi!

Gibt es eine Funktion in Delphi, wenn man die aufruft soll die procedure so lange stoppen bis alle Forms createt sind bzw. alles fertig ist?

_________________
Wo's nix zu gucken gibt, gibts vielleicht was zu hören.
patrick
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1481

WIN2k, WIN XP
D6 Personal, D2005 PE
BeitragVerfasst: Fr 19.03.04 17:58 
nur um sicherzustellen das ich das richtig verstehe:
du willst also eine aktion machen, sobald alle fenster geladen sind?
eine spezielle funktion gibt es leider nicht, aber du kannst es so machen:

wenn du in deiner projektverwaltung auf den exe-namen deines projekt rechtsklickst und "quelltext anzeigen" auswählst, kommt dir ungefähr sowas entgegen:

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:
30:
program Project1;

uses
  Forms,
  Unit1 in 'Unit1.pas' {Form1},
  Unit2 in 'Unit2.pas' {Form2},
  Unit3 in 'Unit3.pas' {Form3},
  Unit4 in 'Unit4.pas' {Form4},
  Unit5 in 'Unit5.pas' {Form5},
  Unit6 in 'Unit6.pas' {Form6},
  Unit7 in 'Unit7.pas' {Form7},
  Unit8 in 'Unit8.pas' {Form8};

{$R *.res}

begin
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.CreateForm(TForm2, Form2);
  Application.CreateForm(TForm3, Form3);
  Application.CreateForm(TForm4, Form4);
  Application.CreateForm(TForm5, Form5);
  Application.CreateForm(TForm6, Form6);
  Application.CreateForm(TForm7, Form7);
  Application.CreateForm(TForm8, Form8);
  Application.Run; //ab jetzt sind alle forms geladen und das programm wird gestartet
  HintPause:=100; //hier kannst du dann eigenen quelltext ausführen
  formxyz.einefunktion //oder eine funktion von einem bestimmtem form aufrufen

end.

_________________
Patrick
im zweifelsfall immer das richtige tun!!!
adler Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 511

Windows XP
Delphi 05 Pers
BeitragVerfasst: Fr 19.03.04 18:32 
Hi!

Diese Seite ist mir bekannt, tatsächlich es geht, also war doch das der Grund dafür ;)

_________________
Wo's nix zu gucken gibt, gibts vielleicht was zu hören.
Brainiac
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Fr 19.03.04 19:06 
Es gibt eine Prozedur, die aufgerufen wird, sobald alles fertig ist, nämlich 'Application.OnIdle'.

Allerdings wird die immer aufgerufen, sobald deine Anwendung nichts mehr zu tun hat, also müsstest du sie im Kontruktor auf eine beliebige passende Prozedur setzen und bei deren ersten Aufruf wieder auf nil.

Aber ich schätze, patricks Ansatz ist hier besser.