unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls, AppEvnts;
type
TFRMMain =
class(TForm)
procedure doAppIdle(Sender: TObject;
var Done: Boolean);
private
procedure OpenParamFile;
{ Private-Deklarationen }
public
procedure AfterConstruction;
override;
{ Public-Deklarationen }
end;
var
FRMMain: TFRMMain;
implementation
uses FRMText;
{$R *.dfm}
procedure TFRMMain.AfterConstruction;
begin
inherited;
Application.OnIdle := doAppIdle;
end;
procedure TFRMMain.OpenParamFile;
Var
f : TTextForm;
begin
if ParamCount > 0
then
if FileExists(ParamStr(1))
then
if UpperCase(ExtractFileExt(ParamStr(1))) = '
.RTF'
then
begin
f := TTextForm.Create(Self);
f.Editor.Lines.LoadFromFile(ParamStr(1));
f.Show;
end;
end;
procedure TFRMMain.doAppIdle(Sender: TObject;
var Done: Boolean);
begin
Application.OnIdle :=
nil;
OpenParamFile;
end;
end.