[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 SetTextColor()   Set the text color to the specified color
 --------------------------------------------------------------------------------

      SetTextColor( <hDC>, <nRGBColor> )  -->  <nRGBColorOld>


  Changes the text color of a specified handle to device context and returns
  the previous Text color of the device context.

  <hDC>             A handle -numeric value- of a Device Context.

  <nRGBColor>       A Color in RGB format. If the system can not use that
                    color, Windows automatically will use the nearest
                    color available.

  <nRGBColorOld>    The previous color in RGB format.


  Device contexts are used in Windows to use 'virtual screens'. Think
  about them in a similar way as when we do DispBegin() and DispEnd()
  in Clipper.

  All work on a device has to be done on its 'device context' and
  later that Device context is dumped onto its device.

  In a similar way as we do in MsDos Clipper DispBegin() ...actions...
  and DispEnd(), in device contexts we create them and later we
  release them.

  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 doing SetTextColor(...).

  FiveWin does that automatically so you don't have to worry about this
  process. Every time you paint on the Window, FiveWin will set the
  correct colors calling internally to SetTextColor() API function and
  some others functions needed.

  Warning: If you incorrectly manipulate Device contexts -not releasing
  them properly, or doing it without balance- you may corrupt all the
  Windows environment, and you will have to go out of Windows and load
  it again to recover control.

This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson