home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / com / inole2 / classlib / cwindow.cpp < prev    next >
C/C++ Source or Header  |  1995-05-03  |  1KB  |  79 lines

  1. /*
  2.  * CWINDOW.CPP
  3.  * Sample Code Class Libraries
  4.  *
  5.  * Implementation of a simple CWindow class.
  6.  *
  7.  * Copyright (c)1993-1995 Microsoft Corporation, All Rights Reserved
  8.  *
  9.  * Kraig Brockschmidt, Microsoft
  10.  * Internet  :  kraigb@microsoft.com
  11.  * Compuserve:  >INTERNET:kraigb@microsoft.com
  12.  */
  13.  
  14.  
  15. #include <windows.h>
  16. #include "classlib.h"
  17.  
  18.  
  19.  
  20. /*
  21.  * CWindow::CWindow
  22.  * CWindow::~CWindow
  23.  *
  24.  * Constructor Parameters:
  25.  *  hInst           HINSTANCE of the task owning us.
  26.  */
  27.  
  28. CWindow::CWindow(HINSTANCE hInst)
  29.     {
  30.     m_hInst=hInst;
  31.     m_hWnd=NULL;
  32.     return;
  33.     }
  34.  
  35. CWindow::~CWindow(void)
  36.     {
  37.     if (IsWindow(m_hWnd))
  38.         DestroyWindow(m_hWnd);
  39.  
  40.     return;
  41.     }
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48. /*
  49.  * CWindow::Window
  50.  *
  51.  * Purpose:
  52.  *  Returns the window handle associated with this object.
  53.  *
  54.  * Return Value:
  55.  *  HWND            Window handle for this object
  56.  */
  57.  
  58. HWND CWindow::Window(void)
  59.     {
  60.     return m_hWnd;
  61.     }
  62.  
  63.  
  64.  
  65. /*
  66.  * CWindow::Instance
  67.  *
  68.  * Purpose:
  69.  *  Returns the instance handle associated with this object.
  70.  *
  71.  * Return Value:
  72.  *  HINSTANCE       Instance handle of the module stored here.
  73.  */
  74.  
  75. HINSTANCE CWindow::Instance(void)
  76.     {
  77.     return m_hInst;
  78.     }
  79.