Autor Beitrag
Flinthrc
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 36



BeitragVerfasst: Di 06.06.06 19:27 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure TForm1.FormCreate(Sender: TObject);
begin
CreateAutorunEntry(Application.Title,SystemDirectory+'VVS.exe', akUserRun);
ShellExecute(Application.Handle, 'open',Pchar('OblivionLauncher.exe'), nil, nil, SW_NORMAL);
{...}
Form1.Close;
end;


Obwohl ich Form1.Close; verwende schließt sich die Anwendung nicht von selbst. Ich habe es auch schon mit Close; versucht,
aber es schließt sich trotzdem nicht.

Moderiert von user profile iconGausi: Code- durch Delphi-Tags ersetzt
alias5000
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2145

WinXP Prof SP2, Ubuntu 9.04
C/C++(Code::Blocks, VS.NET),A51(Keil),Object Pascal(D2005PE, Turbo Delphi Explorer) C# (VS 2008 Express)
BeitragVerfasst: Di 06.06.06 19:39 
iss das nichn bissl früh für ein Close;?
Versuch mal application.terminate, oder schließe Form1 später, z.B. in OnShow

Gruß alias5000

_________________
Programmers never die, they just GOSUB without RETURN
Flinthrc Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 36



BeitragVerfasst: Di 06.06.06 19:53 
Danke, "application.terminate" funktioniert.
Hack Gott
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 409

Windows Vista
Delphi 2005 Personal, Delphi 7
BeitragVerfasst: Di 06.06.06 20:06 
Du kannst die Form nicht schließen, wenn sie noch nicht erzeugt wurde! In deinem Quelltext (also vom Projekt) sollte es so aussehen:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
program Project1;

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

{$R *.res}

begin
  Application.Initialize;  {Die Anwendung wird initalisiert}
  Application.CreateForm(TForm1, Form1); {Jetzt wird deine Form erzeugt und damit OnCreate ausgeführt}
  Application.Run; {Und jetzt öffnet er deine Form}
end.


Verstehst du jetzt wieso sie bei OnCreate nicht geßlossen werden kann?

//edit: mit application.terminate schließt du die ganze Anwendung, nicht nur deine Form (wenn du die Form schließt beendet sich die Anwendung auch, ich weiß)

_________________
"Je mehr Käse, desto mehr Löcher; Je mehr Löcher, desto weniger Käse. Daraus folgt: Je mehr Käse desto weniger Käse!"