Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi Im Hauptprogram auf "Programmstart" reagieren (https://www.delphipraxis.net/65983-im-hauptprogram-auf-programmstart-reagieren.html)

Chris P 23. Mär 2006 08:50


Im Hauptprogram auf "Programmstart" reagieren
 
Hi Leute,

Ich bin gerade an einem Programm, das nur aus der .dpr besteht.
Also keine eigene Unit und auch kein Formular. Nun gibt es dann auch kein
onCreate und onDestroy des Formulars.

Da das Programm keine Fenster hat, entfällt auch die Nachrichtenschleife.

Wie kann ich aber trotzdem auf den Start und das Beenden meines Programmes reagieren?

Klaus01 23. Mär 2006 08:56

Re: Im Hauptprogram auf "Programmstart" reagieren
 
Du hast also eine Consolenanwendung geschrieben.
So weit ich weiß gibt es dort keine Nachrichtenschleife,
deshalb kannst Du auch nicht darauf reagieren wenn deinem
Programm die cmd-shell geschlossen wird.

Zum Programmstart kannst Du ja in Deinem Programm
etwas machen. Dein Programm weiß ja wenn es gestartet wird.

Du kannst auch Units verwenden und dort Initialisierungen
durchführen.

Grüße
Klaus

Chris P 23. Mär 2006 08:58

Re: Im Hauptprogram auf "Programmstart" reagieren
 
Meinst du also,

Delphi-Quellcode:
initialization und finalization
?

Klaus01 23. Mär 2006 09:09

Re: Im Hauptprogram auf "Programmstart" reagieren
 
ja dafür sind die eigentlich da.

Grüße
Klaus

Chris P 23. Mär 2006 09:24

Re: Im Hauptprogram auf "Programmstart" reagieren
 
Werde ich ausprobieren....

Danke!


Alle Zeitangaben in WEZ +1. Es ist jetzt 03:57 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz