home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / dho.zip / DHO / TUTORIAL / EXAMPLE3.CC < prev    next >
C/C++ Source or Header  |  1995-08-30  |  2KB  |  67 lines

  1. /****************************************/
  2. /*    Developer Helper Object Set       */
  3. /*  (C) 1994-95 Thomas E. Bednarz, Jr.  */
  4. /*     All rights reserved              */
  5. /***************************************/
  6.  
  7. /* $Id: example3.cc 1.2 1995/08/30 10:52:32 teb Exp $ */
  8.  
  9. /*******************************************
  10.  *   Example3.cc 
  11.  * 
  12.  *   Example3 demonstrates how to create a 
  13.  *   custom frame window subclass and to
  14.  *   introduce it into a DHO application
  15.  *******************************************/
  16.  
  17. #define INCL_WIN
  18. #include<os2.h>
  19.  
  20. //DHO application object header file
  21. #include<applicat.h>
  22. #include<framewin.h>
  23.  
  24. #define kAppId 100
  25.  
  26. class TExampleFrameWin : public TFrameWindow
  27. {
  28.  
  29.    public:
  30.       TExampleFrameWin(ULONG id, char *title):TFrameWindow(id, title)
  31.       {   fShellPos = TRUE;};
  32.       virtual BOOL init()
  33.       {
  34.          if (TFrameWindow::init())
  35.          {   // add a frame icon
  36.             this->setIcon(WinQuerySysPointer(HWND_DESKTOP, 
  37.                     SPTR_ICONINFORMATION, FALSE));
  38.             return TRUE;
  39.          }
  40.          return FALSE;
  41.       }
  42. };
  43.  
  44.  
  45. class TExampleApp : public TApplication
  46. {
  47.    public:
  48.       TExampleApp(ULONG res):TApplication(res){;};
  49.       virtual void CreateMainWindow()
  50.       {
  51.          MainWin=new TExampleFrameWin(fResource, "DHO Tutorial App");
  52.       }
  53. };
  54.  
  55.  
  56.  
  57. //=========================================
  58. //  program entry point
  59. INT main(void)
  60. {
  61.    TExampleApp app(kAppId);
  62.  
  63.    app.init();     // initialize object
  64.    app.run();      // begin event loop          
  65.  
  66.    return 0;
  67. }