Autor Beitrag
Masterrandy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 55



BeitragVerfasst: Mi 27.08.03 08:47 
Nachdem mein Programm fertig geladen hat und bereit ist, sollen automatisch die Kommandozeilenargumente abgearbeitet werden. Wenn ich das ins FormCreate reinschreibe, bekomme ich Fehler, da das Fenster noch nicht fertig gezeichnet ist. Wo kann ich das aber sonst einbinden. Es soll ja nur einmal ausgewertet werden, bzw. die Aktion nur einmal laufen. Danach soll sich das Programm auch wieder selbst beenden.

Hoffe, das lässt sich machen,

Gruß
ErnestoChe
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 528

Win 2000 pro, CRUX 2.0
Delphi 6 Pers, Open K3
BeitragVerfasst: Mi 27.08.03 08:52 
Hi,

du könntest es in das OnShow-Ereignis schreiben.

MFG

- Ernesto -
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Mi 27.08.03 09:08 
Hallo,

ich schicke, immer wenn ich sofort nach dem Anzeigen des Fensters Code einfüge möchte, eine eigene Message und führe erst dann den Code aus.

Ungefähr so:
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:
const
  WM_AFTER_SHOW = WM_USER + 1;

{...}

Type
  TForm1 = Class (TForm)
    {...}
    Procedure FormShow(Sender: TObject);
    {...}
    Private
      Procedure WmAfterShow(var Msg: TMessage); message WM_AFTER_SHOW;
    {...}
    End;

{...}

Procedure TForm1.FormShow (Sender: tObject);
Begin
  PostMessage (Self.Handle, WM_AFTER_SHOW, 0, 0);
End;

Procedure TForm1.WmAfterShow(var Msg: TMessage);
Begin
 { Hier dein Code }
End;


Gruß
Tino
Masterrandy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 55



BeitragVerfasst: Mi 27.08.03 09:21 
Danke für die Antworten.

Ich habe das Codebeispiel bei mir gleich mal eingebaut und es funzt hervorragend :D Was ich allerdings nicht ganz verstanden habe war dieser Teil:

Zitat:
WM_AFTER_SHOW = WM_USER + 1;


Gruß
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Mi 27.08.03 09:52 
Wenn du eine Message verschicken willst muss du eine eindeutige ID angeben damit die Message auch richtige verarbeitet werden kann. Da es keine ID für diesen Fall gibt erstellst du einfach einen neue Konstante mit einer eindeutigen ID. WM_USER ist auch nur einen Konstante (mit dem Wert $0400) die Delphi definiert hat. Ab diesem Bereich aufwärts soll man eigene IDs definieren.

Gruß
Tino
Masterrandy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 55



BeitragVerfasst: Mi 27.08.03 10:11 
Big THX :)