home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / QUIX.ZIP / QUIX.C < prev    next >
C/C++ Source or Header  |  1990-09-12  |  21KB  |  584 lines

  1. /*
  2. **  Simple Quix Demo program for Presentation Manager.
  3. **
  4. **  Written by:
  5. **    Mitchell Fisher
  6. **    5914 W. Golden Lane
  7. **    Glendale, AZ  85302
  8. **
  9. **    (602) 435-8723
  10. **
  11. **  Special thanks to Charles Petzold and Microsoft for such great
  12. **  documentation from their books.
  13. */
  14.  
  15.  
  16. #define INCL_WIN
  17. #define INCL_GPI
  18. #define INCL_DOS
  19.  
  20. #define BACK_BASE       IDM_B_WHITE
  21. #define FORE_BASE       IDM_F_WHITE
  22. #define TAIL_BASE       10
  23.  
  24. #include <os2.h>
  25. #include <stdlib.h>
  26. #include "Quix.h"
  27.  
  28. #define TIMER1          1
  29.  
  30. #define MAX_LINES       60
  31.  
  32.  
  33. /*
  34.    Global Variable
  35. */
  36.  
  37. SHORT                   cxNew,    /*  New X size of client window */
  38.                         cyNew,    /*  New Y size of client window */
  39.                         idTimer,
  40.                         sMaxCurrentLines = IDM_30,
  41.                         fQuixUpdate,
  42.                         fRandom = 1,         //  1 == true for random colors
  43.                         fColorFlag = 1,      //  1 == true (Color on)
  44.                         sBackGround,         //  Background Color
  45.                         sForeGround,         //  ForeGround Color
  46.                         sQuixDirx1,
  47.                         sQuixDirx2,
  48.                         sQuixDiry1,
  49.                         sQuixDiry2;
  50.  
  51. LONG                    Color = CLR_BLACK,
  52.                         Colors[MAX_LINES + 1],
  53.                         ColorTable[] =
  54.                            {
  55.                               CLR_WHITE,
  56.                               CLR_BLACK,
  57.                               CLR_BLUE,
  58.                               CLR_RED,
  59.                               CLR_PINK,
  60.                               CLR_GREEN,
  61.                               CLR_CYAN,
  62.                               CLR_YELLOW,
  63.                               CLR_DARKGRAY,
  64.                               CLR_DARKBLUE,
  65.                               CLR_DARKRED,
  66.                               CLR_DARKPINK,
  67.                               CLR_DARKGREEN,
  68.                               CLR_DARKCYAN,
  69.                               CLR_BROWN,
  70.                               CLR_PALEGRAY
  71.                            };
  72.  
  73.  
  74.  
  75. POINTL                  ptlQuixPoint1,
  76.                         ptlQuixPoint2;
  77.  
  78. MRESULT EXPENTRY        ClientWndProc(HWND, USHORT, MPARAM, MPARAM);
  79. VOID                    DrawLines(HPS);
  80. VOID                    QuixInitialize(VOID);
  81. SHORT                   GetQuixStep(VOID);
  82.  
  83.  
  84. int main(void)
  85.    {
  86.       static char       szClientClass[] = "Simple QUIX Demo";
  87.       static ULONG      flFrameFlags = FCF_TITLEBAR      | FCF_SYSMENU  |
  88.                                        FCF_SIZEBORDER    | FCF_MINMAX   |
  89.                                        FCF_SHELLPOSITION | FCF_TASKLIST |
  90.                                        FCF_MENU;
  91.  
  92.  
  93.       HAB               hab;
  94.       HPS               hps;
  95.       HMQ               hmq;
  96.       HWND              hwndFrame,
  97.                         hwndClient;
  98.  
  99.       ULONG             ulTime;
  100.  
  101.       QMSG              qmsg;
  102.  
  103.  
  104.       hab = WinInitialize(0);
  105.       hmq = WinCreateMsgQueue(hab, 0);
  106.  
  107.       ulTime = WinGetCurrentTime(hab);
  108.  
  109.       srand((unsigned)ulTime);
  110.  
  111.       WinRegisterClass(hab, szClientClass, ClientWndProc, CS_SIZEREDRAW, 0);
  112.  
  113.       hwndFrame = WinCreateStdWindow(HWND_DESKTOP, WS_VISIBLE,
  114.                                      &flFrameFlags, szClientClass, NULL, 0L,
  115.                                      NULL, ID_RESOURCE, &hwndClient);
  116.  
  117.  
  118.  
  119.       /*
  120.          Set the timer to signal at 2000 milliseconds for color change
  121.       */
  122.       WinStartTimer(hab, hwndClient, TIMER1, 2000);
  123.  
  124.       hps = WinGetPS(hwndClient);
  125.       for (;;)
  126.          {
  127.             if ( WinPeekMsg(hab, &qmsg, NULL, 0, 0, PM_NOREMOVE) )
  128.                {
  129.                   WinGetMsg(hab, &qmsg, NULL, 0, 0);
  130.                   WinDispatchMsg(hab, &qmsg);
  131.                }
  132.  
  133.             if ( qmsg.msg == WM_QUIT )
  134.                   break;
  135.  
  136.             DosSleep((LONG)1);
  137.             DrawLines(hps);
  138.          }
  139.       WinReleasePS(hps);
  140.  
  141.       /*
  142.          Stop the timer
  143.       */
  144.  
  145.       WinStopTimer(hab, hwndClient, TIMER1);
  146.  
  147.       WinDestroyWindow(hwndFrame);
  148.       WinDestroyMsgQueue(hmq);
  149.       WinTerminate(hab);
  150.       return(0);
  151.    }
  152.  
  153.  
  154.  
  155. SHORT GetQuixStep(VOID)
  156.    {
  157.       static SHORT      Array[] = {-8, -6, -4, -3, -2, -1, 1, 2, 3, 4, 6, 8};
  158.  
  159.       SHORT             sIndex;
  160.  
  161.  
  162.  
  163.       sIndex = rand() % 12;
  164.  
  165.       return(Array[sIndex]);
  166.    }
  167.  
  168.  
  169. VOID QuixInitialize(void)
  170.    {
  171.       /*
  172.         Define Step and Direction
  173.       */
  174.  
  175.  
  176.       sQuixDirx1 = GetQuixStep();
  177.       sQuixDirx2 = GetQuixStep();
  178.       sQuixDiry1 = GetQuixStep();
  179.       sQuixDiry2 = GetQuixStep();
  180.  
  181.       ptlQuixPoint1.x = (rand() % cxNew);
  182.       ptlQuixPoint1.y = (rand() % cyNew);
  183.  
  184.       ptlQuixPoint2.x = (rand() % cxNew);
  185.       ptlQuixPoint2.y = (rand() % cyNew);
  186.  
  187.       fQuixUpdate = 1;
  188.    }
  189.  
  190.  
  191. VOID DrawLines(HPS hps)
  192.    {
  193.       static POINTL     aP1[MAX_LINES + 1],
  194.                         aP2[MAX_LINES + 1];
  195.  
  196.       static SHORT      sIndexHead = 0,  /* Index within aP1 or aP2 array */
  197.                         sIndexTail = 0,
  198.                         fLoopFlag = 0;  /*  When the array has been filed */
  199.  
  200.  
  201.  
  202.  
  203.       /*  If QuixInitialize has been called, reset Indexes */
  204.  
  205.       if ( fQuixUpdate )
  206.          {
  207.             fQuixUpdate = 0;
  208.             sIndexHead = 0;
  209.             sIndexTail = 0;
  210.             fLoopFlag = 0;
  211.          }
  212.  
  213.       /*  Move points and draw line between them */
  214.  
  215.       ptlQuixPoint1.x += sQuixDirx1;
  216.       ptlQuixPoint1.y += sQuixDiry1;
  217.  
  218.       ptlQuixPoint2.x += sQuixDirx2;
  219.       ptlQuixPoint2.y += sQuixDiry2;
  220.  
  221.  
  222.  
  223.       if ( (ptlQuixPoint1.x) <= 1 || (ptlQuixPoint1.x >= cxNew - 1) )
  224.          {
  225.             ptlQuixPoint1.x = (ptlQuixPoint1.x <= 1) ? 2 : cxNew - 2;
  226.             sQuixDirx1 = -sQuixDirx1;
  227.          }
  228.  
  229.       if ( (ptlQuixPoint1.y) <= 1 || (ptlQuixPoint1.y >= cyNew - 1) )
  230.          {
  231.             ptlQuixPoint1.y = (ptlQuixPoint1.y <= 1) ? 2 : cyNew - 2;
  232.             sQuixDiry1 = -sQuixDiry1;
  233.          }
  234.  
  235.       if ( (ptlQuixPoint2.x) <= 1 || (ptlQuixPoint2.x >= cxNew - 1) )
  236.          {
  237.             ptlQuixPoint2.x = (ptlQuixPoint2.x <= 1) ? 2 : cxNew - 2;
  238.             sQuixDirx2 = -sQuixDirx2;
  239.          }
  240.  
  241.       if ( (ptlQuixPoint2.y) <= 1 || (ptlQuixPoint2.y >= cyNew - 1) )
  242.          {
  243.             ptlQuixPoint2.y = (ptlQuixPoint2.y <= 1) ? 2 : cyNew - 2;
  244.             sQuixDiry2 = -sQuixDiry2;
  245.          }
  246.  
  247.  
  248.       GpiMove(hps, &ptlQuixPoint1);
  249.       GpiSetColor(hps, ColorTable[Color]);
  250.       GpiLine(hps, &ptlQuixPoint2);
  251.  
  252.       Colors[sIndexHead] = Color;
  253.  
  254.       aP1[sIndexHead].x = ptlQuixPoint1.x;
  255.       aP1[sIndexHead].y = ptlQuixPoint1.y;
  256.  
  257.       aP2[sIndexHead].x = ptlQuixPoint2.x;
  258.       aP2[sIndexHead].y = ptlQuixPoint2.y;
  259.  
  260.       sIndexHead++;
  261.       if ( sIndexHead == sMaxCurrentLines - 1 )
  262.          {
  263.             fLoopFlag = 1;
  264.             sIndexHead = 0;
  265.          }
  266.  
  267.       if ( fLoopFlag )
  268.          {
  269.             GpiMove(hps, &aP1[sIndexTail]);
  270.             GpiSetColor(hps, ColorTable[sBackGround - BACK_BASE]);
  271.             GpiLine(hps, &aP2[sIndexTail]);
  272.  
  273.             sIndexTail++;
  274.             if ( sIndexTail == sMaxCurrentLines - 1)
  275.                   sIndexTail = 0;
  276.          }
  277.    }
  278.  
  279.  
  280.  
  281.  
  282. MRESULT EXPENTRY ClientWndProc(HWND hwnd, USHORT msg, MPARAM mp1, MPARAM mp2)
  283.    {
  284.       static HPS        hps;
  285.  
  286.       static HWND       hwndMenu;
  287.  
  288.       static SHORT      mbAnswer,
  289.                         i;
  290.  
  291.       static RECTL      rcl;
  292.  
  293.       switch (msg)
  294.          {
  295.             case WM_CREATE:
  296.                   hwndMenu = WinWindowFromID(
  297.                                     WinQueryWindow(hwnd, QW_PARENT, FALSE),
  298.                                     FID_MENU);
  299.  
  300.                   sBackGround = IDM_B_WHITE;
  301.                   sForeGround = IDM_F_BLACK;
  302.                   return(0);
  303.  
  304.             case WM_INITMENU:
  305.                   WinSendMsg(hwndMenu, MM_SETITEMATTR,
  306.                              MPFROM2SHORT(sMaxCurrentLines, TRUE),
  307.                              MPFROM2SHORT(MIA_CHECKED, MIA_CHECKED));
  308.  
  309.                   WinSendMsg(hwndMenu, MM_SETITEMATTR,
  310.                              MPFROM2SHORT(sBackGround, TRUE),
  311.                              MPFROM2SHORT(MIA_CHECKED, MIA_CHECKED));
  312.  
  313.                   if ( fRandom )              // Random is off
  314.                      {
  315.                         WinSendMsg(hwndMenu, MM_SETITEMATTR,
  316.                                    MPFROM2SHORT(IDM_F_RANDOM, TRUE),
  317.                                    MPFROM2SHORT(MIA_CHECKED, MIA_CHECKED));
  318.  
  319.                         for ( i = IDM_F_WHITE; i < IDM_F_RANDOM; i++ )
  320.                            {
  321.                               WinSendMsg(hwndMenu, MM_SETITEMATTR,
  322.                                          MPFROM2SHORT(i, TRUE),
  323.                                          MPFROM2SHORT(MIA_DISABLED, MIA_DISABLED));
  324.                            }
  325.                      }
  326.                   else
  327.                      {
  328.                         WinSendMsg(hwndMenu, MM_SETITEMATTR,
  329.                                    MPFROM2SHORT(IDM_F_RANDOM, TRUE),
  330.                                    MPFROM2SHORT(MIA_CHECKED, 0));
  331.  
  332.                         for ( i = IDM_F_WHITE; i < IDM_F_RANDOM; i++ )
  333.                            {
  334.                               WinSendMsg(hwndMenu, MM_SETITEMATTR,
  335.                                          MPFROM2SHORT(i, TRUE),
  336.                                          MPFROM2SHORT(MIA_DISABLED, 0));
  337.                            }
  338.                      }
  339.  
  340.                   WinSendMsg(hwndMenu, MM_SETITEMATTR,
  341.                              MPFROM2SHORT(sForeGround, TRUE),
  342.                              MPFROM2SHORT(MIA_CHECKED, MIA_CHECKED));
  343.                   return(0);
  344.  
  345.                   /*
  346.                      DISABLE corresponding foreground and background colors
  347.                   */
  348.                   WinSendMsg(hwndMenu, MM_SETITEMATTR,
  349.                              MPFROM2SHORT(sForeGround - BACK_BASE, TRUE),
  350.                              MPFROM2SHORT(MIA_DISABLED, MIA_DISABLED));
  351.  
  352.                   WinSendMsg(hwndMenu, MM_SETITEMATTR,
  353.                              MPFROM2SHORT(sBackGround + BACK_BASE, TRUE),
  354.                              MPFROM2SHORT(MIA_DISABLED, MIA_DISABLED));
  355.  
  356.             case WM_SIZE:
  357.                   hps = WinBeginPaint(hwnd, NULL, NULL);
  358.                   WinQueryWindowRect(hwnd, &rcl);
  359.                   WinFillRect(hps, &rcl, ColorTable[sBackGround - BACK_BASE]);
  360.                   WinEndPaint(hps);
  361.                   cxNew = SHORT1FROMMP(mp2);
  362.                   cyNew = SHORT2FROMMP(mp2);
  363.                   QuixInitialize();
  364.                   return(0);
  365.  
  366.             case WM_PAINT:
  367.                   hps = WinBeginPaint(hwnd, NULL, NULL);
  368.                   WinQueryWindowRect(hwnd, &rcl);
  369.                   WinFillRect(hps, &rcl, ColorTable[sBackGround - BACK_BASE]);
  370.                   WinEndPaint(hps);
  371.                   return(0);
  372.  
  373.             case WM_COMMAND:
  374.                {
  375.                   switch (COMMANDMSG(&msg)->cmd)
  376.                      {
  377.                         case IDM_EXIT:
  378.                               mbAnswer = WinMessageBox(HWND_DESKTOP, hwnd, "Thanks for trying out the Quix Demo!",
  379.                                              "Quix Demo", 0, MB_ENTER | MB_INFORMATION);
  380.  
  381.                               if ( mbAnswer == MBID_ENTER )
  382.                                  {
  383.                                     WinPostMsg(hwnd, WM_QUIT, 0L, 0L);
  384.                                     return(0);
  385.                                  }
  386.                               return(0);
  387.  
  388.                         case IDM_10:   /*  Tail size of 10, 20, 30, etc... */
  389.                         case IDM_20:
  390.                         case IDM_30:
  391.                         case IDM_40:
  392.                         case IDM_50:
  393.                         case IDM_60:
  394.                               WinSendMsg(hwndMenu, MM_SETITEMATTR,
  395.                                          MPFROM2SHORT(sMaxCurrentLines, TRUE),
  396.                                          MPFROM2SHORT(MIA_CHECKED, 0));
  397.                               sMaxCurrentLines = COMMANDMSG(&msg)->cmd;
  398.                               hps = WinGetPS(hwnd);
  399.                               WinQueryWindowRect(hwnd, &rcl);
  400.                               WinFillRect(hps, &rcl, ColorTable[sBackGround - BACK_BASE]);
  401.                               WinReleasePS(hps);
  402.                               QuixInitialize();
  403.                               WinSendMsg(hwndMenu, MM_SETITEMATTR,
  404.                                          MPFROM2SHORT(sMaxCurrentLines, TRUE),
  405.                                          MPFROM2SHORT(MIA_CHECKED, MIA_CHECKED));
  406.                               return(0);
  407.  
  408.                         case IDM_B_WHITE:
  409.                         case IDM_B_BLACK:
  410.                         case IDM_B_BLUE:
  411.                         case IDM_B_RED:
  412.                         case IDM_B_PINK:
  413.                         case IDM_B_GREEN:
  414.                         case IDM_B_CYAN:
  415.                         case IDM_B_YELLOW:
  416.                         case IDM_B_DARKGRAY:
  417.                         case IDM_B_DARKBLUE:
  418.                         case IDM_B_DARKRED:
  419.                         case IDM_B_DARKPINK:
  420.                         case IDM_B_DARKGREEN:
  421.                         case IDM_B_DARKCYAN:
  422.                         case IDM_B_BROWN:
  423.                         case IDM_B_PALEGRAY:
  424.                               /*
  425.                                  Clear old Checkmark
  426.                               */
  427.                               WinSendMsg(hwndMenu, MM_SETITEMATTR,
  428.                                          MPFROM2SHORT(sBackGround, TRUE),
  429.                                          MPFROM2SHORT(MIA_CHECKED, 0));
  430.  
  431.                               /*
  432.                                  Clear Corresponding ForeGround Color
  433.                               */
  434.                               WinSendMsg(hwndMenu, MM_SETITEMATTR,
  435.                                          MPFROM2SHORT(sBackGround + BACK_BASE, TRUE),
  436.                                          MPFROM2SHORT(MIA_DISABLED, 0));
  437.  
  438.                               sBackGround = COMMANDMSG(&msg)->cmd;
  439.                               /*
  440.                                  Set new checkmark
  441.                               */
  442.                               WinSendMsg(hwndMenu, MM_SETITEMATTR,
  443.                                          MPFROM2SHORT(sBackGround, TRUE),
  444.                                          MPFROM2SHORT(MIA_CHECKED, MIA_CHECKED));
  445.  
  446.                               /*
  447.                                  DISABLE corresponding foreground color
  448.                               */
  449.                               WinSendMsg(hwndMenu, MM_SETITEMATTR,
  450.                                          MPFROM2SHORT((sBackGround + BACK_BASE), TRUE),
  451.                                          MPFROM2SHORT(MIA_DISABLED, MIA_DISABLED));
  452.  
  453.                               hps = WinGetPS(hwnd);
  454.                               WinQueryWindowRect(hwnd, &rcl);
  455.                               WinFillRect(hps, &rcl, ColorTable[sBackGround - BACK_BASE]);
  456.                               WinReleasePS(hps);
  457.                               QuixInitialize();
  458.  
  459.                               return(0);
  460.  
  461.                         case IDM_F_WHITE:
  462.                         case IDM_F_BLACK:
  463.                         case IDM_F_BLUE:
  464.                         case IDM_F_RED:
  465.                         case IDM_F_PINK:
  466.                         case IDM_F_GREEN:
  467.                         case IDM_F_CYAN:
  468.                         case IDM_F_YELLOW:
  469.                         case IDM_F_DARKGRAY:
  470.                         case IDM_F_DARKBLUE:
  471.                         case IDM_F_DARKRED:
  472.                         case IDM_F_DARKPINK:
  473.                         case IDM_F_DARKGREEN:
  474.                         case IDM_F_DARKCYAN:
  475.                         case IDM_F_BROWN:
  476.                         case IDM_F_PALEGRAY:
  477.                               /*
  478.                                  Clear old Checkmark
  479.                               */
  480.                               WinSendMsg(hwndMenu, MM_SETITEMATTR,
  481.                                          MPFROM2SHORT(sForeGround, TRUE),
  482.                                          MPFROM2SHORT(MIA_CHECKED, 0));
  483.  
  484.                               /*
  485.                                  Clear corresponding background color
  486.                               */
  487.                               WinSendMsg(hwndMenu, MM_SETITEMATTR,
  488.                                          MPFROM2SHORT(sForeGround - BACK_BASE, TRUE),
  489.                                          MPFROM2SHORT(MIA_DISABLED, 0));
  490.  
  491.                               sForeGround = COMMANDMSG(&msg)->cmd;
  492.                               Color = sForeGround - FORE_BASE;
  493.                               hps = WinGetPS(hwnd);
  494.                               GpiSetColor(hps, ColorTable[sForeGround - FORE_BASE]);
  495.  
  496.                               WinReleasePS(hps);
  497.                               QuixInitialize();
  498.                               /*
  499.                                  Set new checkmark
  500.                               */
  501.                               WinSendMsg(hwndMenu, MM_SETITEMATTR,
  502.                                          MPFROM2SHORT(sForeGround, TRUE),
  503.                                          MPFROM2SHORT(MIA_CHECKED, MIA_CHECKED));
  504.  
  505.                               /*
  506.                                  DISABLE corresponding background color
  507.                               */
  508.  
  509.                               WinSendMsg(hwndMenu, MM_SETITEMATTR,
  510.                                          MPFROM2SHORT(sForeGround - BACK_BASE, TRUE),
  511.                                          MPFROM2SHORT(MIA_DISABLED, MIA_DISABLED));
  512.  
  513.                               hps = WinGetPS(hwnd);
  514.                               WinQueryWindowRect(hwnd, &rcl);
  515.                               WinFillRect(hps, &rcl, ColorTable[sBackGround - BACK_BASE]);
  516.                               WinReleasePS(hps);
  517.  
  518.                               return(0);
  519.  
  520.                         case IDM_F_RANDOM:
  521.                               if ( !fRandom )
  522.                                  {
  523.                                     WinSendMsg(hwndMenu, MM_SETITEMATTR,
  524.                                                MPFROM2SHORT(IDM_F_RANDOM, TRUE),
  525.                                                MPFROM2SHORT(MIA_CHECKED, MIA_CHECKED));
  526.  
  527.                                     for ( i = IDM_F_WHITE; i < IDM_F_RANDOM; i++ )
  528.                                        {
  529.                                           WinSendMsg(hwndMenu, MM_SETITEMATTR,
  530.                                                      MPFROM2SHORT(i, TRUE),
  531.                                                      MPFROM2SHORT(MIA_DISABLED, MIA_DISABLED));
  532.                                        }
  533.                                     fRandom = 1;
  534.                                     fColorFlag = 1;
  535.                                  }
  536.                               else
  537.                                  {
  538.                                     WinSendMsg(hwndMenu, MM_SETITEMATTR,
  539.                                                MPFROM2SHORT(IDM_F_RANDOM, TRUE),
  540.                                                MPFROM2SHORT(MIA_CHECKED, 0));
  541.  
  542.                                     for ( i = IDM_F_WHITE; i < IDM_F_RANDOM; i++ )
  543.                                        {
  544.                                           if ( i == (sBackGround + BACK_BASE) ) //  Skip back corresponding color
  545.                                                 continue;
  546.  
  547.                                           WinSendMsg(hwndMenu, MM_SETITEMATTR,
  548.                                                      MPFROM2SHORT(i, TRUE),
  549.                                                      MPFROM2SHORT(MIA_DISABLED, 0));
  550.                                        }
  551.                                     fRandom = 0;
  552.                                     fColorFlag = 0;
  553.                                     Color = ColorTable[sBackGround - BACK_BASE];
  554.                                  }
  555.                               //  DISABLE corresponding background color
  556.  
  557.                               WinSendMsg(hwndMenu, MM_SETITEMATTR,
  558.                                          MPFROM2SHORT(sForeGround - BACK_BASE, TRUE),
  559.                                          MPFROM2SHORT(MIA_DISABLED, MIA_DISABLED));
  560.  
  561.                               return(0);
  562.                      }
  563.                }
  564.  
  565.             case WM_TIMER:
  566.                   sQuixDirx1 = GetQuixStep();
  567.                   sQuixDirx2 = GetQuixStep();
  568.                   sQuixDiry1 = GetQuixStep();
  569.                   sQuixDiry2 = GetQuixStep();
  570.  
  571.                   Color = (rand() % 16);
  572.                   do
  573.                      {
  574.                         Color = (rand() % 16);
  575.                      } while (Color == sBackGround - BACK_BASE);
  576.  
  577.                   if ( !fColorFlag )
  578.                         Color = sForeGround - FORE_BASE;
  579.                   return(0);
  580.          }
  581.       return(WinDefWindowProc(hwnd, msg, mp1, mp2));
  582.    }
  583.  
  584.