home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 May / Pcwk5b98.iso / Borland / Cplus45 / BC45 / APPLAUNC.PAK / APPLAUNC.CPP < prev    next >
C/C++ Source or Header  |  1995-08-29  |  1KB  |  57 lines

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