home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / template.zip / PNT.C < prev    next >
C/C++ Source or Header  |  1998-04-20  |  3KB  |  92 lines

  1. /**************************************************************************
  2.  *  File name  :  pnt.c
  3.  *
  4.  *  Description:  This module contains the code for the main client
  5.  *                window painting.
  6.  *
  7.  *                This source file contains the following functions:
  8.  *
  9.  *                MainPaint(hwnd)
  10.  *
  11.  *  Concepts   :  window painting
  12.  *
  13.  *  API's      :  WinBeginPaint
  14.  *                WinFillRect
  15.  *                WinEndPaint
  16.  *
  17.  *  Required
  18.  *    Files    :  OS2.H, MAIN.H, XTRN.H
  19.  *
  20.  *  Copyright (C) 1991 IBM Corporation
  21.  *
  22.  *      DISCLAIMER OF WARRANTIES.  The following [enclosed] code is
  23.  *      sample code created by IBM Corporation. This sample code is not
  24.  *      part of any standard or IBM product and is provided to you solely
  25.  *      for  the purpose of assisting you in the development of your
  26.  *      applications.  The code is provided "AS IS", without
  27.  *      warranty of any kind.  IBM shall not be liable for any damages
  28.  *      arising out of your use of the sample code, even if they have been
  29.  *      advised of the possibility of such damages.                                                    *
  30.  *************************************************************************/
  31. /*
  32.  *  Include files, macros, defined constants, and externs
  33.  */
  34.  
  35. #define  INCL_WINSYS
  36.  
  37. #include <os2.h>
  38. #include "main.h"
  39. #include "xtrn.h"
  40.  
  41. /*
  42.  *  Global variables
  43.  */
  44.  
  45. /*
  46.  *  Entry point declarations
  47.  */
  48.  
  49.  
  50. /**************************************************************************
  51.  *
  52.  *  Name       : MainPaint(hwnd)
  53.  *
  54.  *  Description: Paints the main client window.
  55.  *
  56.  *  Concepts:  Routine is called whenver the client window
  57.  *             procedure receives a WM_PAINT message
  58.  *
  59.  *             - begins painting by calling WinBeginPaint
  60.  *                 and retrieving the HPS for the window
  61.  *             - performs any painting desired
  62.  *             - ends painting by calling WinEndPaint
  63.  *
  64.  *  API's      :  WinBeginPaint
  65.  *                WinFillRect
  66.  *                WinEndPaint
  67.  *
  68.  *  Parameters :  hwnd     = window handle
  69.  *
  70.  *  Return     :  [none]
  71.  *
  72.  *************************************************************************/
  73. VOID MainPaint(HWND hwnd)
  74. {
  75.    RECTL rclUpdate;
  76.    HPS hps;
  77.  
  78.    hps = WinBeginPaint(hwnd, NULLHANDLE, &rclUpdate);
  79.  
  80.    /* fill update rectangle with window color */
  81.    WinFillRect(hps, &rclUpdate, SYSCLR_WINDOW);
  82.  
  83.    /*
  84.     *      Add painting routines here.  Hps is now
  85.     *      the HPS for the window and rclUpdate
  86.     *      contains the update rectangle.
  87.     */
  88.  
  89.    WinEndPaint(hps);
  90. }   /* End of MainPaint   */
  91. /***************************  End of pnt.c  ****************************/
  92.