Subversion Repositories spacemission

Rev

Rev 80 | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. program SpaceMission;
  2.  
  3. uses
  4.   Windows,
  5.   {$IF CompilerVersion >= 23.0}
  6.   System.UITypes,
  7.   {$IFEND }
  8.   Forms,
  9.   Dialogs,
  10.   SysUtils,
  11.   GamMain in 'GamMain.pas' {MainForm},
  12.   GamSplash in 'GamSplash.pas' {SplashForm},
  13.   GamSpeicherung in 'GamSpeicherung.pas' {SpeicherungForm},
  14.   ComInfo in 'ComInfo.pas' {InfoForm},
  15.   GamCheat in 'GamCheat.pas' {CheatForm},
  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 = 'Das Spiel wurde bereits gestartet.';
  27.   STitel = 'SpaceMission';
  28.   SFileMissing = '%s fehlt. Bitte installieren Sie SpaceMission erneut.';
  29.  
  30. const
  31.   SemaphoreName = 'SpaceMission';
  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(TCheatForm, CheatForm);
  59.   Application.CreateForm(THilfeForm, HilfeForm);
  60.   Application.Run;
  61. end.
  62.  
  63.