[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 hDC                       handle Device Context, API
------------------------------------------------------------------------------


  Contains the current Device Context handle of our Window. This handle
  is retrieved via GetDC() or BeginPaint(), and it becomes
  invalid after EndPaint()  or ReleaseDC()
  
  A device context (DC) is a link between a Windows application, a device
  driver, and an output device, such as the system display or a printer.

  Display contexts are needed to draw in the Windows client area. They
  provide a 'virtual screen', much like the way Clippers DispBegin() and
  DispEnd() works.  All work on a device has to be done on this 'device
  context' and later the contents of that device context are dumped onto
  its device, which could be the display, a printer ..

  Like Clippers DispBegin()/ DispEnd() sequence, device contexts are
  created for an action and released later, and <hDC> is the handle to
  use this context. Windows device contexts don't 'keep' the colors from
  one painting operation to the next, so each time we are going to use a
  certain color we have to Set it to the device context using the function
  SetTextColor()

  FiveWin does this automatically, so you don't have to worry about this
  process. Every time you paint on the Window, FiveWin will set the correct
  colors by internally invoking the neccessary API functions.

 WARNING:
  
  If you incorrectly manipulate Device contexts, like not releasing them
  properly, or creating an unbalanced sequence, you may corrupt the entire
  Windows environment, which will usually crash windows



See Also: SetTextColor GetDC ReleaseDC BeginPaint EndPaint
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson