home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / BC_502 / APPLAUNC.PAK / APPLAUNC.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-06  |  1.5 KB  |  60 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectWindows
  3. // Copyright (c) 1993, 1995 by Borland International, All Rights Reserved
  4. //----------------------------------------------------------------------------
  5. #include <owl/pch.h>
  6. #include <owl/applicat.h>
  7. #include <dir.h>
  8. #include "appbtnba.h"
  9. #include "appwin.h"
  10. #include "applaunc.rh"
  11.  
  12. #if defined(BI_PLAT_WIN32) && defined(_RTLDLL)
  13. extern int __cdecl _setargv__;
  14. #pragma extref  _setargv__
  15. #endif
  16.  
  17. class TAppLauncher : public TApplication {
  18.   public:
  19.     TAppLauncher(char* startupPath);
  20.  
  21.   protected:
  22.     string              StartupPath;    // path to exe.
  23.     TAppButtonBar*      AppButtons;     // Button bar that contains buttons.
  24.  
  25.     void InitMainWindow();
  26.  
  27. };
  28.  
  29. //
  30. // Constructor. Extract the path (without the exe name).
  31. //
  32. TAppLauncher::TAppLauncher(char* startupPath)
  33.   : TApplication()
  34. {
  35.   char drive[MAXDRIVE];
  36.   char dir[MAXDIR];
  37.   fnsplit(startupPath, drive, dir, 0, 0);
  38.   StartupPath = string(drive) + dir;
  39. }
  40.  
  41. //
  42. // InitMainWindow().  Create a default button bar (will be changed later).
  43. // Create frame window with button bar as the client.
  44. //
  45. void TAppLauncher::InitMainWindow()
  46. {
  47.   AppButtons = new TAppButtonBar(0, 1);
  48.   MainWindow = new TAppWindow("Apps", AppButtons, StartupPath);
  49.   MainWindow->SetIcon(this, IDI_APPLAUNCHER);
  50. }
  51.  
  52. //
  53. //
  54. //
  55. int
  56. OwlMain(int /*argc*/, char* argv[])
  57. {
  58.   return TAppLauncher(argv[0]).Run();
  59. }
  60.