Autor Beitrag
fuggaz
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 106



BeitragVerfasst: Sa 12.05.07 17:24 
Hallo,

Zum Ausführen meines Programmes muss der Benutzer eine Datei angeben.
Gibt er sie nicht an, beendet sich das Programm wieder.

Ich habe notdürftig in FormCreate den OpenDialog benutzt und dann beende ich mit Application.Terminate das Programm.
Allerdings blitzt es dann noch einmal kurz auf.
Ich habe schon versucht, das Fenster minimiert zu starten, das lässt Delphi dummerweise nicht zu.
Gibt es eine Möglichkeit mittels Delphisyntax oder WinAPI bevor Application.Create einen OpenDialog zu öffnen und somit einen Dateinamen zu ermitteln?

Ich hoffen ihr habt ein paar Ideen.

mfg fuggaz
(benutze Delphi7)
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Sa 12.05.07 17:33 
Du kannst den Dialog bereits vor Erstellung der Form anzeigen, wenn Du ihn in den Projektquelltext packst:

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 Project2;

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

{$R *.res}

var
  od : TOpenDialog;

begin
  Application.Initialize;

  od := TOpenDialog.Create(nil);
  if od.Execute then
  begin
    Application.CreateForm(TForm2, Form2);
    Application.Run;
  end;
end.

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
fuggaz Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 106



BeitragVerfasst: Sa 12.05.07 17:52 
Super, funktioniert:)

THX

mfg fuggaz