Subversion Repositories spacemission

Rev

Rev 63 | Rev 81 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. program LevEdit;
  2.  
  3. uses
  4.   Windows,
  5.   {$IF CompilerVersion >= 23.0}
  6.   System.UITypes,
  7.   {$IFEND }
  8.   Forms,
  9.   Dialogs,
  10.   SysUtils,
  11.   MMSystem,
  12.   LevMain in 'LevMain.pas' {MainForm},
  13.   LevSplash in 'LevSplash.pas' {SplashForm},
  14.   LevSpeicherung in 'LevSpeicherung.pas' {SpeicherungForm},
  15.   ComInfo in 'ComInfo.pas' {InfoForm},
  16.   LevOptions in 'LevOptions.pas' {LevelForm},
  17.   ComLevelReader in 'ComLevelReader.pas',
  18.   Global in 'Global.pas',
  19.   ComHilfe in 'ComHilfe.pas' {HilfeForm};
  20.  
  21. {$R *.RES}
  22.  
  23. var
  24.   Sem: THandle;
  25.  
  26. resourcestring
  27.   SAlreadyStarted = 'Der Editor wurde bereits gestartet.';
  28.   STitel = 'SpaceMission Leveleditor';
  29.   SFileMissing = '%s fehlt. Bitte installieren Sie SpaceMission erneut.';
  30.  
  31. const
  32.   SemaphoreName = 'SpaceMission Leveleditor';
  33.  
  34. begin
  35.   { Programm schon gestartet? }
  36.   Sem := CreateSemaphore(nil, 0, 1, SemaphoreName);
  37.   if (Sem <> 0) and (GetLastError = ERROR_ALREADY_EXISTS) then
  38.   begin
  39.     CloseHandle(Sem);
  40.     MessageDlg(SAlreadyStarted, mtInformation, [mbOK], 0);
  41.     exit;
  42.   end;
  43.   SplashForm := TSplashForm.Create(Application);
  44.   SplashForm.Show;
  45.   SplashForm.Update;
  46.   Application.Initialize;
  47.   Application.ShowMainform := False;
  48.   Application.MainFormOnTaskBar := true;
  49.   Application.Title := STitel;
  50.   if not fileexists(OwnDirectory+DxgFile) then
  51.   begin
  52.     MessageDLG(Format(SFilemissing, [DxgFile]), mtError, [mbOK], 0);
  53.     exit;
  54.   end;
  55.   Application.CreateForm(TMainForm, MainForm);
  56.   Application.CreateForm(TSpeicherungForm, SpeicherungForm);
  57.   Application.CreateForm(TInfoForm, InfoForm);
  58.   Application.CreateForm(TLevelForm, LevelForm);
  59.   Application.CreateForm(THilfeForm, HilfeForm);
  60.   Application.Run;
  61. end.
  62.  
  63.