home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / das_buch / windows / owl / generic2.pas next >
Encoding:
Pascal/Delphi Source File  |  1993-06-04  |  1.0 KB  |  50 lines

  1. PROGRAM Generic2;
  2.  
  3. {$R Generic2}
  4.  
  5. USES WinTypes, WinProcs, OWindows, ODialogs;
  6.  
  7. CONST
  8.   cm_About = 100;
  9.   AppName  = 'Generic2';
  10.  
  11. TYPE
  12.   pMyWindow = ^tMyWindow;
  13.   tMyWindow = OBJECT (tWindow)
  14.     CONSTRUCTOR Init (aParent: pWindowsObject; aTitle: pChar);
  15.     PROCEDURE cmAbout (VAR Message: tMessage); VIRTUAL cm_First + cm_About;
  16.   END;
  17.  
  18.   tMyApplication = OBJECT (tApplication)
  19.     PROCEDURE InitMainWindow; VIRTUAL;
  20.   END;
  21.  
  22. CONSTRUCTOR tMyWindow.Init (aParent: pWindowsObject; aTitle: pChar);
  23. BEGIN
  24.   tWindow.Init (aParent, aTitle);
  25.   Attr.Menu := LoadMenu (hInstance, AppName);
  26. END;
  27.  
  28. PROCEDURE tMyWindow.cmAbout (VAR Message: tMessage);
  29. VAR
  30.   Dialog: pDialog;
  31. BEGIN
  32.   Dialog := New (pDialog, Init (@Self, MakeIntResource('AboutBox')));
  33.   Dialog^.Execute;
  34.   Dialog^.Done;
  35. END;
  36.  
  37. PROCEDURE tMyApplication.InitMainWindow;
  38. BEGIN
  39.   MainWindow := New (pMyWindow, Init (NIL, 'Borland Pascal OWL Generic'));
  40. END;
  41.  
  42. VAR
  43.   GenericApp: tMyApplication;
  44.  
  45. BEGIN
  46.   GenericApp.Init ('OWLGeneric');
  47.   GenericApp.Run;
  48.   GenericApp.Done;
  49. END.
  50.