Subversion Repositories spacemission

Rev

Rev 81 | 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.   LevMain in 'LevMain.pas' {MainForm},
  12.   LevSplash in 'LevSplash.pas' {SplashForm},
  13.   LevSpeicherung in 'LevSpeicherung.pas' {SpeicherungForm},
  14.   ComInfo in 'ComInfo.pas' {InfoForm},
  15.   LevOptions in 'LevOptions.pas' {LevelForm},
  16.   ComLevelReader in 'ComLevelReader.pas',
  17.   Global in 'Global.pas',
  18.   ComHilfe in 'ComHilfe.pas' {HilfeForm};
  19.  
  20. {$R *.RES}
  21.  
  22. var
  23.   Sem: THandle;
  24.  
  25. resourcestring
  26.   SAlreadyStarted = 'Der Editor wurde bereits gestartet.';
  27.   STitel = 'SpaceMission Level-Editor';
  28.   SFileMissing = '%s fehlt. Bitte installieren Sie SpaceMission erneut.';
  29.  
  30. const
  31.   SemaphoreName = 'SpaceMission Level Editor';
  32.  
  33. begin
  34.   SpaceMission_SwitchLanguage;
  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.