Autor Beitrag
Jojojoxx
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 386



BeitragVerfasst: Di 19.12.06 16:06 
Hallo!

Bei mir soll Form1 unter einer bestimmten Bedingung direkt wieder beendet werden. Ein Aufruf von Form1.Close wird im OnCreate-Ereignis ignoriert und das Ereignis OnShow ist auch nicht für mich nutzbar, da die Anwendung evtl. auch minimiert gestartet wird und das Ereignis daher nicht eintritt. Hat jemand eine Idee, wie ich das lösen kann?
Danke euch!
mfg

Jojo
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Di 19.12.06 16:24 
Schonmal Application.Terminate in OnCreate probiert?

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
Schüler
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 183



BeitragVerfasst: Di 19.12.06 16:25 
close; ins ereignis Form OnActiv schreiben.

_________________
Das Leben ist ein Scheiß Spiel aber es hat eine hammer Grafik und grenzt an realismuss.


Zuletzt bearbeitet von Schüler am Di 19.12.06 16:30, insgesamt 1-mal bearbeitet
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: Di 19.12.06 16:28 
So ginge es auch:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
program Project1;

uses
  Forms,
  Unit1 in 'Unit1.pas' {Form1};

{$R *.res}

begin
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  if (10 = 10) then Application.Terminate; // deine Bedingung
  Application.Run;
end.


Willst du eine Passwortabfrage schreiben´?
Jojojoxx Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 386



BeitragVerfasst: Di 19.12.06 16:53 
Hi!

user profile iconGTA-Place hat folgendes geschrieben:
Schonmal Application.Terminate in OnCreate probiert?

Danke, das hat geklappt!

Nein, es ging nicht um eine Passwordabfrage, sondern um die Bedingung, dass beim Start meines Programms eine andere exe-Datei laufen muss, ansonsten wird mein Progamm beendet.
Danke nochmals für die Hilfe!
mfg

Jojo
freak4fun
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 604
Erhaltene Danke: 4

Win 7 Pro
VS 2013 Express, Delphi, C#, PHP, Java
BeitragVerfasst: Di 19.12.06 17:11 
Ich finde die Lösung sehr unschön! Kannst du nicht vor dem Create prüfen, ob die andere *.exe läuft? :gruebel:

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

uses
  Forms,
  Dialogs,
  Unit2 in 'Unit2.pas' {Form2};

  function IsExeRunning: Boolean;
  begin
    ShowMessage('Hä?');
    Result := False;
  end;

{$R *.res}

begin
  if not IsExeRunning then
    Exit;
  Application.Initialize;
  Application.CreateForm(TForm2, Form2);
  Application.Run;
end.


MfG
freak

_________________
"Ich werde auf GAR KEINEN Fall…!" - "Keks?" - "Okay, ich tu's."
i++; // zaehler i um 1 erhoehen
Jojojoxx Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 386



BeitragVerfasst: Di 19.12.06 17:22 
Hi!

Das wäre in der Tat eine "saubere" Lösung :wink:
Danke!
mfg

Jojo
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: Di 19.12.06 17:28 
habe ich das nicht bereits gepostet? Zumindest so ähnlich... ;)
Jojojoxx Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 386



BeitragVerfasst: Di 19.12.06 17:32 
user profile iconMarc. hat folgendes geschrieben:
habe ich das nicht bereits gepostet? Zumindest so ähnlich... ;)

Oh, sorry! Hatte bei dir übersehen, dass du das auch in Project1 reingeschrieben hast.
Hatte mir nur selektiv das rausgesucht, was ich brauchte...
Trotzdem vielen dank! :wink:
mfg

Jojo
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Di 19.12.06 17:41 
@Marc: Bei deinem wird das Formular erstellt und dann geprüft.

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: Di 19.12.06 19:42 
nein.. wirklich? dann schreibt mans halt davor, so wie man es haben will...
man sollte schon etwas kreativ sein und mitdenken!!