home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c083 / 11.ddi / OWLSRC.PAK / WINDOWDC.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-02  |  874 b   |  41 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectWindows - (C) Copyright 1992, 1993 by Borland International
  3. //   source\owl\windowdc.cpp
  4. //   Implementation of TWindowDC, TScreenDC, TDesktopDC & TClientDC
  5. //----------------------------------------------------------------------------
  6. #include <owl\owlpch.h>
  7. #include <owl\dc.h>
  8.  
  9. TWindowDC::TWindowDC() : TDC()
  10. {
  11. }
  12.  
  13. TWindowDC::TWindowDC(HWND wnd) : TDC(), Wnd(wnd)
  14. {
  15.   Handle = ::GetWindowDC(Wnd);
  16.   CheckValid();
  17. }
  18.  
  19. TWindowDC::~TWindowDC()
  20. {
  21.   RestoreObjects();
  22.   if (ShouldDelete)
  23.     ::ReleaseDC(Wnd, HDC(Handle));
  24.   Handle = 0;
  25. }
  26.  
  27. TScreenDC::TScreenDC() : TWindowDC(0)
  28. {
  29. }
  30.  
  31. TDesktopDC::TDesktopDC() : TWindowDC(::GetDesktopWindow())
  32. {
  33. }
  34.  
  35. TClientDC::TClientDC(HWND wnd) : TWindowDC()
  36. {
  37.   Wnd = wnd;
  38.   Handle = ::GetDC(Wnd);
  39.   CheckValid();
  40. }
  41.