home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / startapp.zip / PNT.C < prev    next >
Text File  |  1998-09-10  |  3KB  |  103 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.  *  (c) Copyright IBM Corp. 1991, 1998  All rights reserved.
  21.  *
  22.  *  These sample programs are owned by International Business Machines
  23.  *  Corporation or one of its subsidiaries ("IBM") and are copyrighted and
  24.  *  licensed, not sold.
  25.  *
  26.  *  You may copy, modify, and distribute these sample programs in any
  27.  *  form without payment to IBM, for any purpose including developing,
  28.  *  using, marketing or distributing programs that include or are
  29.  *  derivative works of the sample programs.
  30.  *
  31.  *  The sample programs are provided to you on an "AS IS" basis, without
  32.  *  warranty of any kind.  IBM HEREBY EXPRESSLY DISCLAIMS ALL WARRANTIES,
  33.  *  EITHER EXPRESS OR IMPLIED, INCLUDING , BUT NOT LIMITED TO, THE IMPLIED
  34.  *  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  35.  *  Some jurisdictions do not allow for the exclusion or limitation of
  36.  *  implied warranties, so the above limitations or exclusions may not
  37.  *  apply to you.  IBM shall not be liable for any damages you suffer
  38.  *  as a result of using, modifying or distributing the sample programs
  39.  *  or their derivatives.
  40.  *************************************************************************/
  41. /*
  42.  *  Include files, macros, defined constants, and externs
  43.  */
  44.  
  45. #define  INCL_WINSYS
  46.  
  47. #include <os2.h>
  48. #include "main.h"
  49. #include "xtrn.h"
  50.  
  51. /*
  52.  *  Global variables
  53.  */
  54.  
  55. /*
  56.  *  Entry point declarations
  57.  */
  58.  
  59. /**************************************************************************
  60.  *
  61.  *  Name       : MainPaint(hwnd)
  62.  *
  63.  *  Description: Paints the main client window.
  64.  *
  65.  *  Concepts:  Routine is called whenever the client window
  66.  *             procedure receives a WM_PAINT message
  67.  *
  68.  *             - begins painting by calling WinBeginPaint
  69.  *                 and retrieving the HPS for the window
  70.  *             - performs any painting desired
  71.  *             - ends painting by calling WinEndPaint
  72.  *
  73.  *  API's      :  WinBeginPaint
  74.  *                WinFillRect
  75.  *                WinEndPaint
  76.  *
  77.  *  Parameters :  hwnd     = window handle
  78.  *
  79.  *  Return     :  [none]
  80.  *
  81.  *************************************************************************/
  82. VOID MainPaint(HWND hwnd)
  83. {
  84.    RECTL rclUpdate;
  85.    RECTL rcl;
  86.    HPS hps;
  87. /* Query new size and position of frame window */
  88.    WinQueryWindowRect(hwnd, &rcl);
  89. /* Reset position and size of List Box child   */
  90.    WinSetWindowPos(hwndList,
  91.       HWND_TOP,
  92.       rcl.xLeft +3 ,
  93.       rcl.yBottom +4 ,
  94.       rcl.xRight +2 ,
  95.       rcl.yTop +3 ,
  96.       SWP_MOVE | SWP_SIZE);
  97. /* Repaint */
  98.    hps = WinBeginPaint(hwnd, NULLHANDLE, &rclUpdate);
  99.  
  100.    WinEndPaint(hps);
  101. }   /* End of MainPaint   */
  102. /***************************  End of pnt.c  ****************************/
  103.