home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Programmierung / SOURCE.mdf / programm / windows / pascal / turbpa / uhrmain.pa_ / uhrmain.pa
Encoding:
Text File  |  1993-03-07  |  2.7 KB  |  80 lines

  1. {*************************************************************************}
  2. {*                                                                       *}
  3. {* Project :                                                             *}
  4. {* Program : Uhr.Pas                                                     *}
  5. {*                                                                       *}
  6. {* Author  : Uwe Janiak                                                  *}
  7. {* Firm    :                                                             *}
  8. {* Adress  : 1055 Berlin, Grellstra▀e 63                                 *}
  9. {*                                                                       *}
  10. {* Created : Montag, den 10. August 1992 um 22:06:06 Uhr                 *}
  11. {* Update  :                                                             *}
  12. {*                                                                       *}
  13. {* Version : Basic source created by Dialog Engine 1.5                   *}
  14. {*                                                                       *}
  15. {*************************************************************************}
  16.  
  17. uses WinTypes, WinProcs, WObjects, WinTools, Uhr;
  18.  
  19. Type  PMainWindow = ^TMainWindow;
  20.       TMainWindow = Object(TWindow)
  21.           constructor Init(ATitel:PChar);
  22.           procedure SetupWindow;virtual;
  23.           procedure wmclose(var msg:tmessage);virtual wm_first+wm_close;
  24.         end;
  25.  
  26.       TEngineApp=Object(TApplication)
  27.           procedure InitMainWindow;virtual;
  28.         end;
  29.  
  30. var EngineApp:TEngineApp;
  31.  
  32. constructor TMainWindow.Init(ATitel:PChar);
  33.   begin
  34.     TWindow.Init(nil,ATitel);
  35.   end;
  36.  
  37. procedure TMainWindow.SetupWindow;
  38. var d:PUhr;
  39.   begin
  40.     TWindow.SetupWindow;
  41.     ShowWindow(hWindow,sw_hide);
  42.     d:=New(PUhr,Init(@self,'DIALOG_1'));
  43.     Application^.ExecDialog(D);
  44.     PostMessage(hWindow,wm_close,0,0);
  45.     if not readwindowposition(hwindow,15,inifile,'Main','WindowState') then
  46.       showwindow(hwindow,sw_normal);
  47.   end;
  48.  
  49. procedure TMainWindow.wmClose;
  50.   begin
  51.     writewindowposition(hwindow,15,inifile,'Main','WindowState');
  52.     TWindow.wmClose(msg);
  53.   end;
  54.  
  55. procedure TEngineApp.InitMainWindow;
  56.   begin
  57.     MainWindow:=New(PMainWindow,Init('Parent Window'));
  58.   end;
  59.  
  60. var hlib:thandle;i:integer;
  61. begin
  62.   If hPrevInst<>0 then
  63.     begin
  64.       Message(paramstr(0)+' lΣuft schon!',33);
  65.       exit;
  66.     end;
  67.   hlib:=LoadLibrary('BWCC.DLL');
  68.   if hlib<32 then
  69.     begin
  70.       Message('Die Datei BWCC.DLL konnte nicht geladen werden.',0);
  71.       exit;
  72.     end;
  73.   GetDir(0,IniFile);
  74.   IniFile:=copy(paramstr(0),1,pos('.',paramstr(0)))+'Ini';
  75.   EngineApp.Init('EngineAPP');
  76.   EngineApp.Run;
  77.   EngineApp.Done;
  78.   Freelibrary(hlib);
  79. end.
  80.