home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR24 / EDMI5.ZIP / PAPER2.ZIP / PAPER.C next >
Text File  |  1993-10-04  |  41KB  |  1,101 lines

  1. #define INCL_GPILCIDS
  2. #define INCL_GPILOGCOLORTABLE
  3. #define INCL_GPIPRIMITIVES
  4. #define INCL_WINENTRYFIELDS
  5. #define INCL_WININPUT
  6. #define INCL_WINMESSAGEMGR
  7. #define INCL_WINRECTANGLES
  8. #define INCL_WINSYS
  9. #define INCL_WINWINDOWMGR
  10. #include <os2.h>
  11. #include <stdlib.h>
  12. #include <string.h>
  13. #include "paper.h"
  14.  
  15. #define PRVM_SETFOCUS               (WM_USER)
  16.  
  17. typedef struct _PAPERINSTDATA {
  18.    USHORT usSzStruct;               // Size of the structure
  19.    HWND hwndOwner;                  // Owner window handle
  20.    HAB habAnchor;                   // Anchor block handle
  21.    HWND hwndText;                   // Entryfield window handle
  22.    PCHAR pchTitle;                  // Title text
  23.    SHORT sMaxLines;                 // Maximum lines based on font size
  24.    SHORT sLine;                     // Current line index
  25.    CHAR aachLines[256][256];        // Line array
  26.    FONTMETRICS fmFont;              // Font metrics
  27.    LONG lForeClr;                   // Foreground color
  28.    LONG lBackClr;                   // Background color
  29. } PAPERINSTDATA, *PPAPERINSTDATA;
  30.  
  31. static MRESULT EXPENTRY pprWndProc(HWND hwndWnd,ULONG ulMsg,MPARAM mpParm1,MPARAM mpParm2)
  32. {
  33.    PPAPERINSTDATA ppidData;
  34.  
  35.    ppidData=(PPAPERINSTDATA)WinQueryWindowPtr(hwndWnd,1);
  36.  
  37.    switch (ulMsg) {
  38.    case WM_CREATE:
  39.       {
  40.          PCREATESTRUCT pcsCreate;
  41.          LONG lColor;
  42.          HPS hpsWnd;
  43.  
  44.          pcsCreate=(PCREATESTRUCT)PVOIDFROMMP(mpParm2);
  45.  
  46.          //----------------------------------------------------------------
  47.          // Allocate and initialize the instance data
  48.          //----------------------------------------------------------------
  49.          ppidData=calloc(1,sizeof(PAPERINSTDATA));
  50.          if (ppidData==NULL) {
  51.             WinAlarm(HWND_DESKTOP,WA_ERROR);
  52.             return MRFROMSHORT(TRUE);
  53.          } /* endif */
  54.  
  55.          WinSetWindowPtr(hwndWnd,1,ppidData);
  56.  
  57.          ppidData->usSzStruct=sizeof(PAPERINSTDATA);
  58.          ppidData->hwndOwner=WinQueryWindow(hwndWnd,QW_OWNER);
  59.          ppidData->habAnchor=WinQueryAnchorBlock(hwndWnd);
  60.  
  61.          ppidData->hwndText=WinCreateWindow(hwndWnd,
  62.                                             WC_ENTRYFIELD,
  63.                                             "",
  64.                                             0,
  65.                                             0,
  66.                                             0,
  67.                                             0,
  68.                                             0,
  69.                                             hwndWnd,
  70.                                             HWND_TOP,
  71.                                             PPR_CID_ENTRYFIELD,
  72.                                             NULL,
  73.                                             NULL);
  74.          if (ppidData->hwndText==NULLHANDLE) {
  75.             WinAlarm(HWND_DESKTOP,WA_ERROR);
  76.             free(ppidData);
  77.             return MRFROMSHORT(TRUE);
  78.          } /* endif */
  79.  
  80.          WinSendMsg(ppidData->hwndText,
  81.                     EM_SETTEXTLIMIT,
  82.                     MPFROMSHORT(256),
  83.                     0);
  84.  
  85.          ppidData->sLine=-1;
  86.  
  87.          hpsWnd=WinGetPS(hwndWnd);
  88.          GpiQueryFontMetrics(hpsWnd,sizeof(FONTMETRICS),&ppidData->fmFont);
  89.          WinReleasePS(hpsWnd);
  90.  
  91.          //----------------------------------------------------------------
  92.          // Set up the presentation parameter initial values.
  93.          //----------------------------------------------------------------
  94.          lColor=CLR_WHITE;
  95.  
  96.          WinSetPresParam(ppidData->hwndText,
  97.                          PP_BACKGROUNDCOLORINDEX,
  98.                          sizeof(lColor),
  99.                          &lColor);
  100.  
  101.          if ((pcsCreate->pszText!=NULL) && (strlen(pcsCreate->pszText)>0)) {
  102.             ppidData->pchTitle=malloc(strlen(pcsCreate->pszText)+1);
  103.             if (ppidData->pchTitle==NULL) {
  104.                WinAlarm(HWND_DESKTOP,WA_ERROR);
  105.                WinDestroyWindow(ppidData->hwndText);
  106.                free(ppidData);
  107.                return MRFROMSHORT(TRUE);
  108.             } /* endif */
  109.  
  110.             strcpy(ppidData->pchTitle,pcsCreate->pszText);
  111.          } else {
  112.             ppidData->pchTitle=NULL;
  113.          } /* endif */
  114.  
  115.          if (pcsCreate->cy>0) {
  116.             ppidData->sMaxLines=(pcsCreate->cy-
  117.                                    ppidData->fmFont.lMaxBaselineExt*2)/
  118.                                    (ppidData->fmFont.lMaxBaselineExt*7/6);
  119.          } else {
  120.             ppidData->sMaxLines=0;
  121.          } /* endif */
  122.  
  123.          ppidData->lForeClr=CLR_BLACK;
  124.          ppidData->lBackClr=CLR_DARKGRAY;
  125.       }
  126.       break;
  127.    case WM_DESTROY:
  128.       if (ppidData->pchTitle!=NULL) {
  129.          free(ppidData->pchTitle);
  130.       } /* endif */
  131.  
  132.       WinDestroyWindow(ppidData->hwndText);
  133.       free(ppidData);
  134.       break;
  135.    case WM_SIZE:
  136.       {
  137.          RECTL rclLine;
  138.  
  139.          //----------------------------------------------------------------
  140.          // Recalculate the maximum number of lines and reposition the
  141.          // entryfield.
  142.          //----------------------------------------------------------------
  143.          if (ppidData->sLine>-1) {
  144.             WinSendMsg(hwndWnd,
  145.                        PPM_QUERYLINERECT,
  146.                        MPFROMP(&rclLine),
  147.                        MPFROMSHORT(ppidData->sLine));
  148.  
  149.             WinSetWindowPos(ppidData->hwndText,
  150.                             NULLHANDLE,
  151.                             rclLine.xLeft,
  152.                             rclLine.yBottom,
  153.                             rclLine.xRight-rclLine.xLeft,
  154.                             rclLine.yTop-rclLine.yBottom,
  155.                             SWP_MOVE|SWP_SIZE|SWP_SHOW);
  156.          } /* endif */
  157.  
  158.          ppidData->sMaxLines=(SHORT2FROMMP(mpParm2)-
  159.                                 ppidData->fmFont.lMaxBaselineExt*2)/
  160.                                 (ppidData->fmFont.lMaxBaselineExt*7/6);
  161.       }
  162.       break;
  163.    case WM_SETFOCUS:
  164.       WinPostMsg(hwndWnd,PRVM_SETFOCUS,mpParm1,mpParm2);
  165.       break;
  166.    case WM_BUTTON1DOWN:
  167.       {
  168.          RECTL rclWnd;
  169.  
  170.          //----------------------------------------------------------------
  171.          // Before we change the line, update the text array from the
  172.          // current line
  173.          //----------------------------------------------------------------
  174.          if (ppidData->sLine>-1) {
  175.             WinQueryWindowText(ppidData->hwndText,
  176.                                sizeof(ppidData->aachLines[ppidData->sLine]),
  177.                                ppidData->aachLines[ppidData->sLine]);
  178.          } /* endif */
  179.  
  180.          //----------------------------------------------------------------
  181.          // Query the line clicked on
  182.          //----------------------------------------------------------------
  183.          rclWnd.xLeft=SHORT1FROMMP(mpParm1);
  184.          rclWnd.yBottom=SHORT2FROMMP(mpParm1);
  185.  
  186.          WinSendMsg(hwndWnd,
  187.                     PPM_CONVERTPOINTS,
  188.                     MPFROMP(&rclWnd.xLeft),
  189.                     MPFROMSHORT(1));
  190.  
  191.          //----------------------------------------------------------------
  192.          // If the place clicked on is one of the lines, set the new
  193.          // entryfield position to that line
  194.          //----------------------------------------------------------------
  195.          if (rclWnd.yBottom>-1) {
  196.             WinSendMsg(hwndWnd,PPM_SETCURRENTLINE,MPFROMP(rclWnd.yBottom),0);
  197.             WinShowWindow(ppidData->hwndText,TRUE);
  198.             WinSetWindowText(ppidData->hwndText,
  199.                              ppidData->aachLines[ppidData->sLine]);
  200.          } else {
  201.             ppidData->sLine=-1;
  202.             WinShowWindow(ppidData->hwndText,FALSE);
  203.          } /* endif */
  204.  
  205.          WinSetFocus(HWND_DESKTOP,hwndWnd);
  206.       }
  207.       break;
  208.    case WM_BUTTON1UP:
  209.       WinSendMsg(ppidData->hwndOwner,
  210.                  WM_CONTROL,
  211.                  MPFROM2SHORT(WinQueryWindowUShort(hwndWnd,QWS_ID),
  212.                               PPN_CLICKED),
  213.                  MPFROM2SHORT(ppidData->sLine,1));
  214.       break;
  215.    case WM_BUTTON2UP:
  216.       WinSendMsg(ppidData->hwndOwner,
  217.                  WM_CONTROL,
  218.                  MPFROM2SHORT(WinQueryWindowUShort(hwndWnd,QWS_ID),
  219.                               PPN_CLICKED),
  220.                  MPFROM2SHORT(ppidData->sLine,2));
  221.       break;
  222.    case WM_BUTTON3UP:
  223.       WinSendMsg(ppidData->hwndOwner,
  224.                  WM_CONTROL,
  225.                  MPFROM2SHORT(WinQueryWindowUShort(hwndWnd,QWS_ID),
  226.                               PPN_CLICKED),
  227.                  MPFROM2SHORT(ppidData->sLine,3));
  228.       break;
  229.    case WM_BUTTON1DBLCLK:
  230.       WinSendMsg(ppidData->hwndOwner,
  231.                  WM_CONTROL,
  232.                  MPFROM2SHORT(WinQueryWindowUShort(hwndWnd,QWS_ID),
  233.                               PPN_DBLCLICKED),
  234.                  MPFROM2SHORT(ppidData->sLine,1));
  235.       break;
  236.    case WM_BUTTON2DBLCLK:
  237.       WinSendMsg(ppidData->hwndOwner,
  238.                  WM_CONTROL,
  239.                  MPFROM2SHORT(WinQueryWindowUShort(hwndWnd,QWS_ID),
  240.                               PPN_DBLCLICKED),
  241.                  MPFROM2SHORT(ppidData->sLine,2));
  242.       break;
  243.    case WM_BUTTON3DBLCLK:
  244.       WinSendMsg(ppidData->hwndOwner,
  245.                  WM_CONTROL,
  246.                  MPFROM2SHORT(WinQueryWindowUShort(hwndWnd,QWS_ID),
  247.                               PPN_DBLCLICKED),
  248.                  MPFROM2SHORT(ppidData->sLine,3));
  249.       break;
  250.    case WM_CONTEXTMENU:
  251.       WinSendMsg(ppidData->hwndOwner,
  252.                  WM_CONTROL,
  253.                  MPFROM2SHORT(WinQueryWindowUShort(hwndWnd,QWS_ID),
  254.                               PPN_CONTEXTMENU),
  255.                  MPFROMSHORT(ppidData->sLine));
  256.       break;
  257.    case WM_HELP:
  258.       WinSendMsg(ppidData->hwndOwner,
  259.                  WM_CONTROL,
  260.                  MPFROM2SHORT(WinQueryWindowUShort(hwndWnd,QWS_ID),PPN_HELP),
  261.                  0);
  262.       break;
  263.    case WM_CHAR:
  264.       if ((CHARMSG(&ulMsg)->fs & (KC_VIRTUALKEY | KC_KEYUP))==
  265.           KC_VIRTUALKEY) {
  266.          switch (CHARMSG(&ulMsg)->vkey) {
  267.          case VK_UP:
  268.             {
  269.                RECTL rclLine;
  270.  
  271.                //----------------------------------------------------------
  272.                // Remember, we can only go up if there is another line
  273.                // above us
  274.                //----------------------------------------------------------
  275.                if (ppidData->sLine>0) {
  276.                   WinQueryWindowText(ppidData->hwndText,
  277.                                      sizeof(ppidData->aachLines[ppidData->sLine]),
  278.                                      ppidData->aachLines[ppidData->sLine]);
  279.  
  280.                   ppidData->sLine--;
  281.  
  282.                   WinSendMsg(hwndWnd,
  283.                              PPM_QUERYLINERECT,
  284.                              MPFROMP(&rclLine),
  285.                              MPFROMSHORT(ppidData->sLine));
  286.                   WinSetWindowPos(ppidData->hwndText,
  287.                                   NULLHANDLE,
  288.                                   rclLine.xLeft,
  289.                                   rclLine.yBottom,
  290.                                   0,
  291.                                   0,
  292.                                   SWP_MOVE);
  293.                   WinSetWindowText(ppidData->hwndText,
  294.                                    ppidData->aachLines[ppidData->sLine]);
  295.  
  296.                   //-------------------------------------------------------
  297.                   // We only invalidate the line we left because the
  298.                   // entryfield paints itself
  299.                   //-------------------------------------------------------
  300.                   WinSendMsg(hwndWnd,
  301.                              PPM_QUERYLINERECT,
  302.                              MPFROMP(&rclLine),
  303.                              MPFROMSHORT(ppidData->sLine+1));
  304.                   WinInvalidateRect(hwndWnd,&rclLine,TRUE);
  305.                   WinUpdateWindow(hwndWnd);
  306.  
  307.                   WinSendMsg(ppidData->hwndOwner,
  308.                              WM_CONTROL,
  309.                              MPFROM2SHORT(WinQueryWindowUShort(hwndWnd,QWS_ID),
  310.                                           PPN_UP),
  311.                              MPFROMSHORT(ppidData->sLine));
  312.                } else
  313.                if (ppidData->sLine==0) {
  314.                   WinSendMsg(ppidData->hwndOwner,
  315.                              WM_CONTROL,
  316.                              MPFROM2SHORT(WinQueryWindowUShort(hwndWnd,QWS_ID),
  317.                                           PPN_BEGINPAGE),
  318.                              MPFROMSHORT(ppidData->sLine));
  319.                } /* endif */
  320.             }
  321.             break;
  322.          //----------------------------------------------------------------
  323.          // We treat newline and enter the same as down arrow
  324.          //----------------------------------------------------------------
  325.          case VK_DOWN:
  326.          case VK_NEWLINE:
  327.          case VK_ENTER:
  328.             {
  329.                RECTL rclLine;
  330.  
  331.                //----------------------------------------------------------
  332.                // Remember, we can only go down if there is another line
  333.                // below us
  334.                //----------------------------------------------------------
  335.                if ((ppidData->sLine>-1) &&
  336.                    (ppidData->sLine<ppidData->sMaxLines-1)) {
  337.                   WinQueryWindowText(ppidData->hwndText,
  338.                                      sizeof(ppidData->aachLines[ppidData->sLine]),
  339.                                      ppidData->aachLines[ppidData->sLine]);
  340.  
  341.                   ppidData->sLine++;
  342.  
  343.                   WinSendMsg(hwndWnd,
  344.                              PPM_QUERYLINERECT,
  345.                              MPFROMP(&rclLine),
  346.                              MPFROMSHORT(ppidData->sLine));
  347.                   WinSetWindowPos(ppidData->hwndText,
  348.                                   NULLHANDLE,
  349.                                   rclLine.xLeft,
  350.                                   rclLine.yBottom,
  351.                                   0,
  352.                                   0,
  353.                                   SWP_MOVE);
  354.                   WinSetWindowText(ppidData->hwndText,
  355.                                    ppidData->aachLines[ppidData->sLine]);
  356.  
  357.                   //-------------------------------------------------------
  358.                   // We only invalidate the line we left because the
  359.                   // entryfield paints itself
  360.                   //-------------------------------------------------------
  361.                   WinSendMsg(hwndWnd,
  362.                              PPM_QUERYLINERECT,
  363.                              MPFROMP(&rclLine),
  364.                              MPFROMSHORT(ppidData->sLine-1));
  365.                   WinInvalidateRect(hwndWnd,&rclLine,TRUE);
  366.                   WinUpdateWindow(hwndWnd);
  367.  
  368.                   WinSendMsg(ppidData->hwndOwner,
  369.                              WM_CONTROL,
  370.                              MPFROM2SHORT(WinQueryWindowUShort(hwndWnd,QWS_ID),
  371.                                           PPN_DOWN),
  372.                              MPFROMSHORT(ppidData->sLine));
  373.                } else
  374.                if (ppidData->sLine==ppidData->sMaxLines-1) {
  375.                   WinSendMsg(ppidData->hwndOwner,
  376.                              WM_CONTROL,
  377.                              MPFROM2SHORT(WinQueryWindowUShort(hwndWnd,QWS_ID),
  378.                                           PPN_ENDPAGE),
  379.                              MPFROMSHORT(ppidData->sLine));
  380.                } /* endif */
  381.             }
  382.             break;
  383.          default:
  384.             return WinDefWindowProc(hwndWnd,ulMsg,mpParm1,mpParm2);
  385.          } /* endswitch */
  386.       } else {
  387.          return WinDefWindowProc(hwndWnd,ulMsg,mpParm1,mpParm2);
  388.       } /* endif */
  389.       break;
  390.    case WM_PAINT:
  391.       {
  392.          ULONG ulStyle;
  393.          HPS hpsPaint;
  394.          RECTL rclPaint;
  395.          RECTL rclWnd;
  396.          POINTL ptlPoint;
  397.          SHORT sIndex;
  398.          RECTL rclLine;
  399.          USHORT usMaxHoles;
  400.          RECTL rclHole;
  401.  
  402.          ulStyle=WinQueryWindowULong(hwndWnd,QWL_STYLE);
  403.  
  404.          hpsPaint=WinBeginPaint(hwndWnd,NULLHANDLE,&rclPaint);
  405.          WinFillRect(hpsPaint,&rclPaint,CLR_WHITE);
  406.  
  407.          WinQueryWindowRect(hwndWnd,&rclWnd);
  408.  
  409.          //----------------------------------------------------------------
  410.          // Paint the border first
  411.          //
  412.          //               +------------+
  413.          //              +|-----------+|
  414.          //              ||           ||
  415.          //              ||           ||
  416.          //              ||           ||
  417.          // White -----> ||           || <----- Dark gray
  418.          //              ||           ||
  419.          //              |+------------+
  420.          //              +------------+
  421.          //----------------------------------------------------------------
  422.          if ((ulStyle & PPS_BORDER)!=0) {
  423.             GpiSetColor(hpsPaint,CLR_WHITE);
  424.  
  425.             ptlPoint.x=rclWnd.xLeft+1;
  426.             ptlPoint.y=rclWnd.yBottom;
  427.             GpiMove(hpsPaint,&ptlPoint);
  428.  
  429.             ptlPoint.x=rclWnd.xRight;
  430.             ptlPoint.y=rclWnd.yTop-1;
  431.             GpiBox(hpsPaint,DRO_OUTLINE,&ptlPoint,0,0);
  432.  
  433.             GpiSetColor(hpsPaint,CLR_DARKGRAY);
  434.  
  435.             ptlPoint.x=rclWnd.xLeft;
  436.             ptlPoint.y=rclWnd.yBottom+1;
  437.             GpiMove(hpsPaint,&ptlPoint);
  438.  
  439.             ptlPoint.x=rclWnd.xRight-1;
  440.             ptlPoint.y=rclWnd.yTop;
  441.             GpiBox(hpsPaint,DRO_OUTLINE,&ptlPoint,0,0);
  442.  
  443.             WinInflateRect(ppidData->habAnchor,&rclWnd,-2,-2);
  444.          } /* endif */
  445.  
  446.          //----------------------------------------------------------------
  447.          // Paint the vertical line.  Check the window style to see what
  448.          // side it is on.
  449.          //----------------------------------------------------------------
  450.          if ((ulStyle & PPS_HOLESNONE)!=0) {
  451.             ptlPoint.x=rclWnd.xLeft+ppidData->fmFont.lAveCharWidth*5;
  452.          } else
  453.          if ((ulStyle & PPS_HOLESRIGHT)!=0) {
  454.             ptlPoint.x=rclWnd.xRight-ppidData->fmFont.lAveCharWidth*5;
  455.          } else {
  456.             ptlPoint.x=rclWnd.xLeft+ppidData->fmFont.lAveCharWidth*5;
  457.          } /* endif */
  458.  
  459.          ptlPoint.y=rclWnd.yBottom;
  460.          GpiMove(hpsPaint,&ptlPoint);
  461.  
  462.          ptlPoint.y=rclWnd.yTop;
  463.          GpiSetColor(hpsPaint,CLR_PINK);
  464.          GpiLine(hpsPaint,&ptlPoint);
  465.  
  466.          //----------------------------------------------------------------
  467.          // Paint the horizontal lines.  Our strategy is to query each
  468.          // line rectangle, and draw a line along the top edge of this
  469.          // rectangle.  This means the bottom edge of the bottom line
  470.          // will not get painted, so explicitly handle this case.
  471.          //----------------------------------------------------------------
  472.          GpiSetColor(hpsPaint,CLR_DARKCYAN);
  473.  
  474.          for (sIndex=0; sIndex<ppidData->sMaxLines; sIndex++) {
  475.             WinSendMsg(hwndWnd,
  476.                        PPM_QUERYLINERECT,
  477.                        MPFROMP(&rclLine),
  478.                        MPFROMSHORT(sIndex));
  479.             ptlPoint.x=rclWnd.xLeft;
  480.             ptlPoint.y=rclLine.yTop;
  481.             GpiMove(hpsPaint,&ptlPoint);
  482.             ptlPoint.x=rclWnd.xRight;
  483.             GpiLine(hpsPaint,&ptlPoint);
  484.          } /* endfor */
  485.  
  486.          ptlPoint.x=rclWnd.xLeft;
  487.          ptlPoint.y=rclLine.yBottom-1;
  488.          GpiMove(hpsPaint,&ptlPoint);
  489.          ptlPoint.x=rclWnd.xRight;
  490.          GpiLine(hpsPaint,&ptlPoint);
  491.  
  492.          //----------------------------------------------------------------
  493.          // Note that if PPS_HOLESNONE was specified, 0 is returned
  494.          //----------------------------------------------------------------
  495.          usMaxHoles=SHORT1FROMMR(WinSendMsg(hwndWnd,PPM_QUERYNUMHOLES,0,0));
  496.  
  497.          for (sIndex=0; sIndex<usMaxHoles; sIndex++) {
  498.             WinSendMsg(hwndWnd,
  499.                        PPM_QUERYHOLERECT,
  500.                        MPFROMP(&rclHole),
  501.                        MPFROMSHORT(sIndex));
  502.  
  503.             ptlPoint.x=rclHole.xLeft+(rclHole.xRight-rclHole.xLeft)/2;
  504.             ptlPoint.y=rclHole.yBottom+(rclHole.yTop-rclHole.yBottom)/2;
  505.             GpiMove(hpsPaint,&ptlPoint);
  506.             GpiSetColor(hpsPaint,CLR_PALEGRAY);
  507.             GpiFullArc(hpsPaint,
  508.                        DRO_FILL,
  509.                        MAKEFIXED(ppidData->fmFont.lAveCharWidth,0));
  510.             GpiSetColor(hpsPaint,CLR_DARKGRAY);
  511.             GpiFullArc(hpsPaint,
  512.                        DRO_OUTLINE,
  513.                        MAKEFIXED(ppidData->fmFont.lAveCharWidth,0));
  514.          } /* endfor */
  515.  
  516.          if (ppidData->pchTitle!=NULL) {
  517.             WinSendMsg(hwndWnd,
  518.                        PPM_QUERYLINERECT,
  519.                        MPFROMP(&rclLine),
  520.                        MPFROMSHORT(0));
  521.             rclLine.yBottom=rclLine.yTop+1;
  522.             rclLine.yTop=rclLine.yBottom+ppidData->fmFont.lMaxBaselineExt;
  523.  
  524.             WinDrawText(hpsPaint,
  525.                         -1,
  526.                         ppidData->pchTitle,
  527.                         &rclLine,
  528.                         ppidData->lForeClr,
  529.                         0,
  530.                         DT_CENTER);
  531.          } /* endif */
  532.  
  533.          WinSendMsg(hwndWnd,
  534.                     PPM_CONVERTPOINTS,
  535.                     MPFROMP(&rclPaint),
  536.                     MPFROMSHORT(2));
  537.  
  538.          if (rclPaint.yTop<0) {
  539.             rclPaint.yTop=0;
  540.          } /* endif */
  541.  
  542.          if ((rclPaint.yBottom>ppidData->sMaxLines-1) ||
  543.              (rclPaint.yBottom<0)) {
  544.             rclPaint.yBottom=ppidData->sMaxLines-1;
  545.          } /* endif */
  546.  
  547.          while (rclPaint.yTop<=rclPaint.yBottom) {
  548.             WinSendMsg(hwndWnd,
  549.                        PPM_QUERYLINERECT,
  550.                        MPFROMP(&rclLine),
  551.                        MPFROMSHORT(rclPaint.yTop));
  552.  
  553.             if (strlen(ppidData->aachLines[rclPaint.yTop])>0) {
  554.                WinDrawText(hpsPaint,
  555.                            -1,
  556.                            ppidData->aachLines[rclPaint.yTop],
  557.                            &rclLine,
  558.                            ppidData->lBackClr,
  559.                            0,
  560.                            DT_LEFT|DT_BOTTOM);
  561.             } /* endif */
  562.  
  563.             rclPaint.yTop++;
  564.          } /* endwhile */
  565.  
  566.          WinEndPaint(hpsPaint);
  567.       }
  568.       break;
  569.    case WM_QUERYWINDOWPARAMS:
  570.       {
  571.          PWNDPARAMS pwpParms;
  572.  
  573.          pwpParms=(PWNDPARAMS)PVOIDFROMMP(mpParm1);
  574.  
  575.          //----------------------------------------------------------------
  576.          // Check for the window text
  577.          //----------------------------------------------------------------
  578.          if ((pwpParms->fsStatus & WPM_TEXT)!=0) {
  579.             pwpParms->pszText[0]=0;
  580.             strncat(pwpParms->pszText,ppidData->pchTitle,pwpParms->cchText);
  581.             WinDefWindowProc(hwndWnd,ulMsg,mpParm1,mpParm2);
  582.             return MRFROMSHORT(TRUE);
  583.          } /* endif */
  584.  
  585.          return WinDefWindowProc(hwndWnd,ulMsg,mpParm1,mpParm2);
  586.       }
  587.    case WM_SETWINDOWPARAMS:
  588.       {
  589.          BOOL bProcessed;
  590.          PWNDPARAMS pwpParms;
  591.  
  592.          bProcessed=FALSE;
  593.          pwpParms=(PWNDPARAMS)PVOIDFROMMP(mpParm1);
  594.  
  595.          //----------------------------------------------------------------
  596.          // Check for the window text
  597.          //----------------------------------------------------------------
  598.          if ((pwpParms->fsStatus & WPM_TEXT)!=0) {
  599.             if (ppidData->pchTitle!=NULL) {
  600.                free(ppidData->pchTitle);
  601.                ppidData->pchTitle=NULL;
  602.             } /* endif */
  603.  
  604.             if ((pwpParms->pszText!=NULL) && (strlen(pwpParms->pszText)>0)) {
  605.                ppidData->pchTitle=malloc(strlen(pwpParms->pszText)+1);
  606.                strcpy(ppidData->pchTitle,pwpParms->pszText);
  607.             } /* endif */
  608.  
  609.             bProcessed=TRUE;
  610.          } /* endif */
  611.  
  612.          if (bProcessed) {
  613.             WinInvalidateRect(hwndWnd,NULL,TRUE);
  614.             WinUpdateWindow(hwndWnd);
  615.             WinDefWindowProc(hwndWnd,ulMsg,mpParm1,mpParm2);
  616.             return MRFROMSHORT(TRUE);
  617.          } else {
  618.             return WinDefWindowProc(hwndWnd,ulMsg,mpParm1,mpParm2);
  619.          } /* endif */
  620.       }
  621.    case WM_PRESPARAMCHANGED:
  622.       switch (LONGFROMMP(mpParm1)) {
  623.       case PP_FOREGROUNDCOLOR:
  624.       case PP_FOREGROUNDCOLORINDEX:
  625.          {
  626.             ULONG ulId;
  627.             LONG lColor;
  628.             HPS hpsWnd;
  629.             SHORT sIndex;
  630.             RECTL rclLine;
  631.  
  632.             //-------------------------------------------------------------
  633.             // The pres param has already been changed, so we can query
  634.             // it.
  635.             //-------------------------------------------------------------
  636.             WinQueryPresParam(hwndWnd,
  637.                               PP_FOREGROUNDCOLORINDEX,
  638.                               LONGFROMMP(mpParm1),
  639.                               &ulId,
  640.                               sizeof(lColor),
  641.                               &lColor,
  642.                               QPF_NOINHERIT);
  643.  
  644.             if (ulId==PP_FOREGROUNDCOLOR) {
  645.                hpsWnd=WinGetPS(hwndWnd);
  646.                lColor=GpiQueryColorIndex(hpsWnd,0,lColor);
  647.                WinReleasePS(hpsWnd);
  648.             } /* endif */
  649.  
  650.             ppidData->lForeClr=lColor;
  651.  
  652.             for (sIndex=0; sIndex<ppidData->sMaxLines; sIndex++) {
  653.                if (ppidData->aachLines[sIndex][0]!=0) {
  654.                   WinSendMsg(hwndWnd,
  655.                              PPM_QUERYLINERECT,
  656.                              MPFROMP(&rclLine),
  657.                              MPFROMSHORT(sIndex));
  658.                   WinInvalidateRect(hwndWnd,NULL,TRUE);
  659.                } /* endif */
  660.             } /* endfor */
  661.  
  662.             WinUpdateWindow(hwndWnd);
  663.          }
  664.          break;
  665.       case PP_BACKGROUNDCOLOR:
  666.       case PP_BACKGROUNDCOLORINDEX:
  667.          {
  668.             ULONG ulId;
  669.             LONG lColor;
  670.             HPS hpsWnd;
  671.             SHORT sIndex;
  672.             RECTL rclLine;
  673.  
  674.             //-------------------------------------------------------------
  675.             // The pres param has already been changed, so we can query
  676.             // it.
  677.             //-------------------------------------------------------------
  678.             WinQueryPresParam(hwndWnd,
  679.                               PP_BACKGROUNDCOLORINDEX,
  680.                               LONGFROMMP(mpParm1),
  681.                               &ulId,
  682.                               sizeof(lColor),
  683.                               &lColor,
  684.                               QPF_NOINHERIT);
  685.  
  686.             if (ulId==PP_BACKGROUNDCOLOR) {
  687.                hpsWnd=WinGetPS(hwndWnd);
  688.                lColor=GpiQueryColorIndex(hpsWnd,0,lColor);
  689.                WinReleasePS(hpsWnd);
  690.             } /* endif */
  691.  
  692.             ppidData->lBackClr=lColor;
  693.  
  694.             for (sIndex=0; sIndex<ppidData->sMaxLines; sIndex++) {
  695.                if (ppidData->aachLines[sIndex][0]!=0) {
  696.                   WinSendMsg(hwndWnd,
  697.                              PPM_QUERYLINERECT,
  698.                              MPFROMP(&rclLine),
  699.                              MPFROMSHORT(sIndex));
  700.                   WinInvalidateRect(hwndWnd,NULL,TRUE);
  701.                } /* endif */
  702.             } /* endfor */
  703.  
  704.             WinUpdateWindow(hwndWnd);
  705.          }
  706.          break;
  707.       case PP_FONTNAMESIZE:
  708.       case PP_FONTHANDLE:
  709.          {
  710.             HPS hpsWnd;
  711.             RECTL rclWnd;
  712.  
  713.             //-------------------------------------------------------------
  714.             // The pres param has already been changed, so we can get a
  715.             // micro-cached HPS and query its FONTMETRICS.
  716.             //-------------------------------------------------------------
  717.             hpsWnd=WinGetPS(hwndWnd);
  718.             GpiQueryFontMetrics(hpsWnd,sizeof(FONTMETRICS),&ppidData->fmFont);
  719.             WinReleasePS(hpsWnd);
  720.  
  721.             WinQueryWindowRect(hwndWnd,&rclWnd);
  722.             WinSendMsg(hwndWnd,
  723.                        WM_SIZE,
  724.                        0,
  725.                        MPFROM2SHORT((SHORT)rclWnd.xRight,
  726.                                     (SHORT)rclWnd.yTop));
  727.             WinInvalidateRect(hwndWnd,NULL,TRUE);
  728.             WinUpdateWindow(hwndWnd);
  729.          }
  730.          break;
  731.       default:
  732.          return WinDefWindowProc(hwndWnd,ulMsg,mpParm1,mpParm2);
  733.       } /* endswitch */
  734.       break;
  735.    case PPM_QUERYMAXLINES:
  736.       return MRFROMSHORT(ppidData->sMaxLines);
  737.    case PPM_QUERYCURRENTLINE:
  738.       return MRFROMSHORT(ppidData->sLine);
  739.    case PPM_QUERYLINERECT:
  740.       {
  741.          PRECTL prclLine;
  742.          SHORT sLine;
  743.          ULONG ulStyle;
  744.          ULONG ulCyLine;
  745.  
  746.          prclLine=(PRECTL)PVOIDFROMMP(mpParm1);
  747.          sLine=SHORT1FROMMP(mpParm2);
  748.  
  749.          ulStyle=WinQueryWindowULong(hwndWnd,QWL_STYLE);
  750.  
  751.          if ((sLine<0) || (sLine>ppidData->sMaxLines-1)) {
  752.             return MRFROMSHORT(FALSE);
  753.          } /* endif */
  754.  
  755.          WinQueryWindowRect(hwndWnd,prclLine);
  756.          WinInflateRect(ppidData->habAnchor,prclLine,-2,-2);
  757.  
  758.          prclLine->yTop-=ppidData->fmFont.lMaxBaselineExt*2;
  759.  
  760.          ulCyLine=ppidData->fmFont.lMaxBaselineExt*7/6;
  761.  
  762.          if ((ulStyle & PPS_HOLESNONE)!=0) {
  763.             prclLine->xLeft+=ppidData->fmFont.lAveCharWidth*5+2;
  764.             prclLine->xRight-=ppidData->fmFont.lAveCharWidth;
  765.          } else
  766.          if ((ulStyle & PPS_HOLESRIGHT)!=0) {
  767.             prclLine->xLeft+=ppidData->fmFont.lAveCharWidth;
  768.             prclLine->xRight-=ppidData->fmFont.lAveCharWidth*5+2;
  769.          } else {
  770.             prclLine->xLeft+=ppidData->fmFont.lAveCharWidth*5+2;
  771.             prclLine->xRight-=ppidData->fmFont.lAveCharWidth;
  772.          } /* endif */
  773.  
  774.          prclLine->yTop-=sLine*ulCyLine;
  775.          prclLine->yBottom=prclLine->yTop-ulCyLine+1;
  776.  
  777.          //----------------------------------------------------------------------
  778.          // Adjust the top so that the rectangle doesn't interfere with the
  779.          // dividing lines that are drawn
  780.          //----------------------------------------------------------------------
  781.          prclLine->yTop--;
  782.  
  783.          return MRFROMSHORT(TRUE);
  784.       }
  785.    case PPM_QUERYNUMHOLES:
  786.       {
  787.          ULONG ulStyle;
  788.  
  789.          ulStyle=WinQueryWindowULong(hwndWnd,QWL_STYLE);
  790.          return MRFROMSHORT(((ulStyle & PPS_HOLESNONE)!=0)?0:3);
  791.       }
  792.    case PPM_QUERYHOLERECT:
  793.       {
  794.          USHORT usHole;
  795.          PRECTL prclWnd;
  796.          RECTL rclWnd;
  797.          ULONG ulStyle;
  798.  
  799.          usHole=SHORT1FROMMP(mpParm2);
  800.          if (usHole>2) {
  801.             return MRFROMSHORT(FALSE);
  802.          } /* endif */
  803.  
  804.          prclWnd=(PRECTL)PVOIDFROMMP(mpParm1);
  805.  
  806.          WinQueryWindowRect(hwndWnd,&rclWnd);
  807.          WinInflateRect(ppidData->habAnchor,&rclWnd,-2,-2);
  808.  
  809.          ulStyle=WinQueryWindowULong(hwndWnd,QWL_STYLE);
  810.  
  811.          //----------------------------------------------------------------
  812.          // First calculate the center of the hole and then expand the
  813.          // recentangle from there
  814.          //----------------------------------------------------------------
  815.          if ((ulStyle & PPS_HOLESNONE)!=0) {
  816.             return MRFROMSHORT(FALSE);
  817.          } else
  818.          if ((ulStyle & PPS_HOLESRIGHT)!=0) {
  819.             prclWnd->xLeft=rclWnd.xRight-ppidData->fmFont.lAveCharWidth*3;
  820.          } else {
  821.             prclWnd->xLeft=rclWnd.xLeft+ppidData->fmFont.lAveCharWidth*3;
  822.          } /* endif */
  823.  
  824.          prclWnd->yBottom=(rclWnd.yTop-rclWnd.yBottom)/8+usHole*
  825.                               (rclWnd.yTop-rclWnd.yBottom)*3/8;
  826.  
  827.          prclWnd->xLeft-=ppidData->fmFont.lAveCharWidth;
  828.          prclWnd->yBottom-=ppidData->fmFont.lAveCharWidth;
  829.          prclWnd->xRight=prclWnd->xLeft+ppidData->fmFont.lAveCharWidth*2;
  830.          prclWnd->yTop=prclWnd->yBottom+ppidData->fmFont.lAveCharWidth*2;
  831.  
  832.          return MRFROMSHORT(TRUE);
  833.       }
  834.    case PPM_QUERYLINETEXT:
  835.       {
  836.          SHORT sLine;
  837.          USHORT usSzBuf;
  838.          PCHAR pchBuf;
  839.  
  840.          sLine=SHORT1FROMMP(mpParm1);
  841.          usSzBuf=SHORT2FROMMP(mpParm1);
  842.          pchBuf=(PCHAR)PVOIDFROMMP(mpParm2);
  843.  
  844.          if (sLine<ppidData->sMaxLines) {
  845.             pchBuf[0]=0;
  846.             strncat(pchBuf,ppidData->aachLines[sLine],usSzBuf);
  847.             return MRFROMSHORT(TRUE);
  848.          } else {
  849.             return MRFROMSHORT(FALSE);
  850.          } /* endif */
  851.       }
  852.    case PPM_QUERYLINETEXTLEN:
  853.       {
  854.          SHORT sLine;
  855.  
  856.          sLine=SHORT1FROMMP(mpParm1);
  857.  
  858.          if (sLine<ppidData->sMaxLines) {
  859.             return MRFROMSHORT(strlen(ppidData->aachLines[sLine]));
  860.          } else {
  861.             return MRFROMSHORT(-1);
  862.          } /* endif */
  863.       }
  864.    case PPM_QUERYPAPERTEXT:
  865.       {
  866.          PCHAR pchBuf;
  867.          SHORT sSzBuf;
  868.          SHORT sEndLine;
  869.          SHORT sIndex;
  870.  
  871.          pchBuf=(PCHAR)PVOIDFROMMP(mpParm1);
  872.          *pchBuf=0;
  873.  
  874.          sSzBuf=SHORT1FROMMP(mpParm2);
  875.  
  876.          sEndLine=ppidData->sMaxLines-1;
  877.          while ((sEndLine>=0) && (strlen(ppidData->aachLines[sEndLine])==0)) {
  878.             sEndLine--;
  879.          } /* endwhile */
  880.  
  881.          if (sEndLine<0) {
  882.             return MRFROMSHORT(FALSE);
  883.          } /* endif */
  884.  
  885.          sEndLine++;
  886.  
  887.          for (sIndex=0; (sIndex<sEndLine) && (sSzBuf>0); sIndex++) {
  888.             strncat(pchBuf,ppidData->aachLines[sIndex],sSzBuf-1);
  889.             sSzBuf-=strlen(ppidData->aachLines[sIndex]);
  890.  
  891.             if (sSzBuf>1) {
  892.                strncat(pchBuf,"\n",sSzBuf-1);
  893.                sSzBuf-=strlen("\n");
  894.             } /* endif */
  895.          } /* endfor */
  896.  
  897.          return MRFROMSHORT(TRUE);
  898.       }
  899.    case PPM_QUERYPAPERTEXTLEN:
  900.       {
  901.          SHORT sTextLen;
  902.          SHORT sIndex;
  903.  
  904.          sTextLen=0;
  905.  
  906.          for (sIndex=0; sIndex<ppidData->sMaxLines; sIndex++) {
  907.             sTextLen+=strlen(ppidData->aachLines[sIndex])+1;
  908.          } /* endfor */
  909.  
  910.          return MRFROMSHORT(sTextLen);
  911.       }
  912.    case PPM_SETCURRENTLINE:
  913.       {
  914.          SHORT sLine;
  915.          RECTL rclLine;
  916.  
  917.          sLine=SHORT1FROMMP(mpParm1);
  918.          if ((sLine<0) && (sLine>ppidData->sMaxLines-1)) {
  919.             return MRFROMSHORT(FALSE);
  920.          } /* endif */
  921.  
  922.          ppidData->sLine=sLine;
  923.  
  924.          WinSendMsg(hwndWnd,
  925.                     PPM_QUERYLINERECT,
  926.                     MPFROMP(&rclLine),
  927.                     MPFROMSHORT(ppidData->sLine));
  928.  
  929.          WinSetWindowPos(ppidData->hwndText,
  930.                          NULLHANDLE,
  931.                          rclLine.xLeft,
  932.                          rclLine.yBottom,
  933.                          rclLine.xRight-rclLine.xLeft,
  934.                          rclLine.yTop-rclLine.yBottom,
  935.                          SWP_MOVE|SWP_SIZE);
  936.       }
  937.       break;
  938.    case PPM_SETLINETEXT:
  939.       {
  940.          SHORT sLine;
  941.          RECTL rclText;
  942.  
  943.          sLine=SHORT1FROMMP(mpParm1);
  944.  
  945.          //----------------------------------------------------------------
  946.          // Update the line array if needed and repaint
  947.          //----------------------------------------------------------------
  948.          if (sLine<ppidData->sMaxLines) {
  949.             strcpy(ppidData->aachLines[sLine],PVOIDFROMMP(mpParm2));
  950.  
  951.             WinSendMsg(hwndWnd,
  952.                        PPM_QUERYLINERECT,
  953.                        MPFROMP(&rclText),
  954.                        MPFROMSHORT(sLine));
  955.             WinInvalidateRect(hwndWnd,&rclText,TRUE);
  956.             WinUpdateWindow(hwndWnd);
  957.  
  958.             return MRFROMSHORT(TRUE);
  959.          } else {
  960.             return MRFROMSHORT(FALSE);
  961.          } /* endif */
  962.       }
  963.    case PPM_SETPAPERTEXT:
  964.       {
  965.          PCHAR pchText;
  966.          SHORT sLine;
  967.          PCHAR pchBegin;
  968.          PCHAR pchEnd;
  969.  
  970.          pchText=(PCHAR)PVOIDFROMMP(mpParm1);
  971.  
  972.          memset(ppidData->aachLines,0,sizeof(ppidData->aachLines));
  973.  
  974.          if (pchText==NULL) {
  975.             return MRFROMSHORT(TRUE);
  976.          } /* endif */
  977.  
  978.          sLine=0;
  979.          pchBegin=pchText;
  980.          pchEnd=strchr(pchBegin,'\n');
  981.          if (pchEnd==NULL) {
  982.             pchEnd=pchBegin+strlen(pchBegin);
  983.          } /* endif */
  984.  
  985.          while (sLine<ppidData->sMaxLines) {
  986.             strncat(ppidData->aachLines[sLine],pchBegin,pchEnd-pchBegin);
  987.  
  988.             if (*pchEnd==0) {
  989.                sLine=ppidData->sMaxLines;
  990.             } else {
  991.                sLine++;
  992.                pchBegin=pchEnd+1;
  993.                pchEnd=strchr(pchBegin,'\n');
  994.                if (pchEnd==NULL) {
  995.                   pchEnd=pchBegin+strlen(pchBegin);
  996.                } /* endif */
  997.             } /* endif */
  998.          } /* endwhile */
  999.  
  1000.          if (ppidData->sLine>-1) {
  1001.             WinSetWindowText(ppidData->hwndText,
  1002.                              ppidData->aachLines[ppidData->sLine]);
  1003.          } /* endif */
  1004.  
  1005.          WinInvalidateRect(hwndWnd,NULL,FALSE);
  1006.          WinUpdateWindow(hwndWnd);
  1007.          return MRFROMSHORT(TRUE);
  1008.       }
  1009.    case PPM_CONVERTPOINTS:
  1010.       {
  1011.          PPOINTL pptlPoint;
  1012.          USHORT usNumPoints;
  1013.          RECTL rclWnd;
  1014.          ULONG ulCyLine;
  1015.          USHORT usIndex;
  1016.  
  1017.          //----------------------------------------------------------------
  1018.          // This message converts the y-coordinates to the corresponding
  1019.          // line numbers.  The x-coordinates are ignored.
  1020.          //----------------------------------------------------------------
  1021.  
  1022.          pptlPoint=(PPOINTL)PVOIDFROMMP(mpParm1);
  1023.          usNumPoints=SHORT1FROMMP(mpParm2);
  1024.  
  1025.          WinQueryWindowRect(hwndWnd,&rclWnd);
  1026.          WinInflateRect(ppidData->habAnchor,&rclWnd,-2,-2);
  1027.  
  1028.          //----------------------------------------------------------------
  1029.          // Adjust for the top margin
  1030.          //----------------------------------------------------------------
  1031.          rclWnd.yTop-=ppidData->fmFont.lMaxBaselineExt*2;
  1032.  
  1033.          ulCyLine=ppidData->fmFont.lMaxBaselineExt*7/6;
  1034.  
  1035.          for (usIndex=0; usIndex<usNumPoints; usIndex++) {
  1036.             if ((pptlPoint->y<rclWnd.yTop) &&
  1037.                 (pptlPoint->y>=rclWnd.yBottom)) {
  1038.                pptlPoint->y=(rclWnd.yTop-pptlPoint->y)/ulCyLine;
  1039.             } else {
  1040.                pptlPoint->y=-1;
  1041.             } /* endif */
  1042.  
  1043.             pptlPoint++;
  1044.          } /* endfor */
  1045.       }
  1046.       break;
  1047.    case PRVM_SETFOCUS:
  1048.       if (SHORT1FROMMP(mpParm2)) {
  1049.          if (ppidData->sLine>-1) {
  1050.             WinShowWindow(ppidData->hwndText,TRUE);
  1051.             WinFocusChange(HWND_DESKTOP,
  1052.                            ppidData->hwndText,
  1053.                            FC_NOLOSEACTIVE|FC_NOLOSEFOCUS|FC_NOLOSESELECTION);
  1054.          } /* endif */
  1055.  
  1056.          WinSendMsg(ppidData->hwndOwner,
  1057.                     WM_CONTROL,
  1058.                     MPFROM2SHORT(WinQueryWindowUShort(hwndWnd,QWS_ID),
  1059.                                  PPN_SETFOCUS),
  1060.                     0);
  1061.       } else {
  1062.          //----------------------------------------------------------------
  1063.          // If we're losing the focus, update the text array, but leave the
  1064.          // entryfield text alone.
  1065.          //----------------------------------------------------------------
  1066.          if (ppidData->sLine>-1) {
  1067.             WinQueryWindowText(ppidData->hwndText,
  1068.                                sizeof(ppidData->aachLines[ppidData->sLine]),
  1069.                                ppidData->aachLines[ppidData->sLine]);
  1070.             WinShowWindow(ppidData->hwndText,FALSE);
  1071.          } /* endif */
  1072.  
  1073.          WinSendMsg(ppidData->hwndOwner,
  1074.                     WM_CONTROL,
  1075.                     MPFROM2SHORT(WinQueryWindowUShort(hwndWnd,QWS_ID),
  1076.                                  PPN_KILLFOCUS),
  1077.                     0);
  1078.       } /* endif */
  1079.       break;
  1080.    default:
  1081.       return WinDefWindowProc(hwndWnd,ulMsg,mpParm1,mpParm2);
  1082.    } /* endswitch */
  1083.  
  1084.    return MRFROMSHORT(FALSE);
  1085. }
  1086.  
  1087. BOOL PprInitialize(HAB habAnchor)
  1088. {
  1089.    WinRegisterClass(habAnchor,
  1090.                     WC_PAPERPAGE,
  1091.                     pprWndProc,
  1092.                     CS_SIZEREDRAW|CS_CLIPSIBLINGS|CS_PARENTCLIP,
  1093.                     sizeof(PVOID)*2);
  1094.    return TRUE;
  1095. }
  1096.  
  1097. BOOL PprTerminate(HAB habAnchor)
  1098. {
  1099.    return TRUE;
  1100. }
  1101.