home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 4 Power Pack / Visual_Basic4_Power_Pack.bin / vb4files / scentbns / bndemo3.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-11-20  |  43.0 KB  |  1,113 lines

  1. //***************************************************************************
  2. //
  3. //  PROGRAM   : BNDEMO3.CPP
  4. //
  5. //  PROGRAMMER: Steven R Clabaugh
  6. //              SRC Enterprises
  7. //
  8. //  PURPOSE   : Bare-bones Windows MFC application used to demonstrate
  9. //              Button Control Class.
  10. //              Does not use a VIEW class or a DOCUMENT class.
  11. //
  12. //***************************************************************************
  13. #include <afxwin.h>
  14. #include <srcentbn.h>
  15. #include "resource.h"
  16. #include "bndemo3.h"
  17.  
  18. //***************************************************************************
  19. //***************************************************************************
  20. // Implementation for the application class 'CTheApp'
  21. //***************************************************************************
  22. //***************************************************************************
  23.  
  24. //***************************************************************************
  25. //
  26. //  Application Class 'InitApplication' member function
  27. //
  28. //***************************************************************************
  29. BOOL CTheApp::InitApplication()
  30. {
  31.  
  32.    // The reason we register a window class is to provide the ability to set
  33.    // the client area to the color of our choice.
  34.    // The class name is returned in the application class m_ClassName
  35.    // data member and passed to the CMainWnd class's contructor within the
  36.    // InitInstance function.
  37.    m_WndClassName = AfxRegisterWndClass(
  38.                        NULL,                               // Class Style
  39.                        LoadStandardCursor(IDC_ARROW),      // Cursor
  40.                        CreateSolidBrush(RGB(192,192,192)), // Client Area Color
  41.                        LoadIcon(AFX_IDI_STD_FRAME)         // Application Icon
  42.                  );
  43.  
  44.    return TRUE;
  45.  
  46. } // End CTheApp::InitApplication
  47.  
  48. //***************************************************************************
  49. //
  50. //  Application Class 'InitInstance' member function
  51. //
  52. //  Creates and shows the main window
  53. //
  54. //***************************************************************************
  55. BOOL CTheApp::InitInstance()
  56. {
  57.  
  58.    //  Declare the Application's Main Window object
  59.    //    and call its constructor
  60.    m_pMainWnd = new CMainWnd(m_WndClassName);
  61.  
  62.    // Make the window visable; Update its client area; return successfull
  63.    m_pMainWnd->ShowWindow(m_nCmdShow);   // Show the window
  64.    m_pMainWnd->UpdateWindow();           // Sends WM_PAINT Msg
  65.    return TRUE;
  66.  
  67. } // End CTheApp::InitInstance
  68.  
  69. //**** End Application Class Implementation *********************************
  70. //***************************************************************************
  71. //***************************************************************************
  72.  
  73. //***************************************************************************
  74. //***************************************************************************
  75. // Implementation for the application's Main Window class 'CMainWnd'
  76. //***************************************************************************
  77. //***************************************************************************
  78.  
  79. //***************************************************************************
  80. //
  81. //  CMainWnd Class Constructor
  82. //
  83. //***************************************************************************
  84. CMainWnd::CMainWnd(CString WndClassName)
  85. {
  86.  
  87.    // Create the Main Window
  88.    Create(WndClassName,                  // Window Class Name
  89.           AfxGetAppName(),               // Text for Window Title Bar
  90.           WS_OVERLAPPEDWINDOW,           // Window Style
  91.           CRect(10,10,425,280),          // Window Position and Size
  92.           NULL,                          // Overlapped Windows have no Parent
  93.           "MAINMENU",                    // Main Menu Resource Name
  94.           0,                             // No Extened style attributes
  95.           NULL                           // Pointer Not Needed
  96.          );
  97.  
  98.    cBuff = "         ";
  99.    TextColor = RGB(0,0,0);  // Init to Black
  100.    
  101. } // End CMainWnd::CMainWnd Class Constructor
  102.  
  103. //***************************************************************************
  104. //
  105. //  Create the message map for the main window procedure
  106. //
  107. //***************************************************************************
  108. BEGIN_MESSAGE_MAP(CMainWnd, CFrameWnd)
  109.    //{{AFX_MSG_MAP(CMainWnd)
  110.    ON_COMMAND(ID_APP_ABOUT,OnAbout)
  111.    ON_COMMAND(IDBN_VSPIN1,OnVSpin1)
  112.    ON_COMMAND(IDBN_VSPIN2,OnVSpin2)
  113.    ON_COMMAND(IDBN_VSPIN3,OnVSpin3)
  114.    ON_COMMAND(IDBN_VSPIN4,OnVSpin4)
  115.    ON_COMMAND(IDBN_VSPIN5,OnVSpin5)
  116.    ON_COMMAND(IDBN_VSPIN6,OnVSpin6)
  117.    ON_COMMAND(IDBN_HSPIN1,OnHSpin1)
  118.    ON_COMMAND(IDBN_HSPIN2,OnHSpin2)
  119.    ON_COMMAND(IDBN_HSPIN3,OnHSpin3)
  120.    ON_COMMAND(IDBN_HSPIN4,OnHSpin4)
  121.    ON_COMMAND(IDBN_HSPIN5,OnHSpin5)
  122.    ON_COMMAND(IDBN_HSPIN6,OnHSpin6)
  123.    ON_COMMAND(IDBN_NFTSW,OnNFTSw)
  124.    ON_COMMAND(IDBN_SWITCH1,OnSwitch1)
  125.    ON_COMMAND(IDBN_REDBUTTON,OnRedBut)
  126.    ON_COMMAND(IDBN_GRNBUTTON,OnGrnBut)
  127.    ON_COMMAND(IDBN_BLUBUTTON,OnBluBut)
  128.    ON_COMMAND(IDBN_YELBUTTON,OnYelBut)
  129.    ON_COMMAND(IDBN_CYNBUTTON,OnCynBut)
  130.    ON_COMMAND(IDBN_MAGBUTTON,OnMagBut)
  131.    ON_COMMAND(IDBN_GRYBUTTON,OnGryBut)
  132.    ON_COMMAND(IDBN_BLKBUTTON,OnBlkBut)
  133.    ON_COMMAND(IDBN_VOLUME,OnVolume)
  134.    ON_COMMAND(IDBN_VOLED,OnVoled)
  135.    ON_WM_PAINT()   
  136.    ON_WM_CREATE()
  137.    //}}AFX_MSG_MAP
  138. END_MESSAGE_MAP()
  139.  
  140. //**** End Message Map ******************************************************
  141.  
  142. //***************************************************************************
  143. //
  144. //  Main Window WM_CREATE Message Handler
  145. //
  146. //***************************************************************************
  147. int CMainWnd::OnCreate(LPCREATESTRUCT lpCreateStruct)
  148. {
  149.  
  150.  
  151.    // One note to make here, is that the last 3 parms in the Create
  152.    // functions must be type cast to UINT when programming with MFC
  153.    // style programming. 
  154.  
  155.    // Create Spin Button on the Main windlow client area.
  156.    // This will be vertical, using the size 1 predefined bitmaps.
  157.    m_VSpin1.Create(
  158.       BTN_VERT | BTN_SPIN1,         // Vertical size 1 
  159.       0,0,0,0,                      // No User Bitmap
  160.       20,10,                        // Spin button position
  161.       0,0,                          // Spin button size (use defaults)
  162.       1,                            // Step value
  163.       0,100,                        // range
  164.       50,                           // Initial value
  165.       150,10,                       // Delay, Speed
  166.       TRUE,                         // Use Hand Cursor
  167.       (UINT)m_hWnd,                 // Parent window handle
  168.       (UINT)IDBN_VSPIN1,            // ID Value
  169.       (UINT)AfxGetInstanceHandle()  // Program instance
  170.    );
  171.  
  172.    // EDIT control to display the above Spin Button value
  173.    m_VSPEdit1.Create(
  174.       WS_CHILD | WS_VISIBLE | WS_BORDER | WS_DISABLED,
  175.       CRect(35,10,67,32),     // Position and Size(35,10,32,22)
  176.       this,                   // Parent window
  177.       IDED_VSPEDIT1);         // ID
  178.  
  179.    wsprintf((LPSTR)cBuff.GetBuffer(9),"%d",m_VSpin1.GetVal());
  180.    m_VSPEdit1.SetWindowText(cBuff);
  181.  
  182.    // Create Spin Button on the Main windlow client area.
  183.    // This will be vertical, using the size 2 predefined bitmaps.
  184.    m_VSpin2.Create(
  185.       BTN_VERT | BTN_SPIN2,         // Vertical size 2
  186.       0,0,0,0,                      // No User Bitmap
  187.       18,40,                        // Spin button position
  188.       0,0,                          // Spin button size (use defaults)
  189.       1,                            // Step value
  190.       0,100,                        // range
  191.       50,                           // Initial value
  192.       150,10,                       // Delay, Speed
  193.       TRUE,                         // Use Hand Cursor
  194.       (UINT)m_hWnd,                 // Parent window handle
  195.       (UINT)IDBN_VSPIN2,            // ID Value
  196.       (UINT)AfxGetInstanceHandle()  // Program instance
  197.    );
  198.  
  199.    // EDIT control to display the above Spin Button value
  200.    m_VSPEdit2.Create(
  201.       WS_CHILD | WS_VISIBLE | WS_BORDER | WS_DISABLED,
  202.       CRect(35,40,67,62),     // Position and Size(35,40,32,22)
  203.       this,                   // Parent window
  204.       IDED_VSPEDIT2);         // ID
  205.  
  206.    wsprintf((LPSTR)cBuff.GetBuffer(9),"%d",m_VSpin2.GetVal());
  207.    m_VSPEdit2.SetWindowText(cBuff);
  208.  
  209.    // Create Spin Button on the Main windlow client area.
  210.    // This will be vertical, using the size 3 predefined bitmaps.
  211.    m_VSpin3.Create(
  212.       BTN_VERT | BTN_SPIN3,         // Vertical size 3
  213.       0,0,0,0,                      // No User Bitmap
  214.       16,70,                        // Spin button position
  215.       0,0,                          // Spin button size (use defaults)
  216.       1,                            // Step value
  217.       0,100,                        // range
  218.       50,                           // Initial value
  219.       150,10,                       // Delay, Speed
  220.       TRUE,                         // Use Hand Cursor
  221.       (UINT)m_hWnd,                 // Parent window handle
  222.       (UINT)IDBN_VSPIN3,            // ID Value
  223.       (UINT)AfxGetInstanceHandle()  // Program instance
  224.    );
  225.  
  226.    // EDIT control to display the above Spin Button value
  227.    m_VSPEdit3.Create(
  228.       WS_CHILD | WS_VISIBLE | WS_BORDER | WS_DISABLED,
  229.       CRect(35,70,67,92),     // Position and Size(35,70,32,22)
  230.       this,                   // Parent window
  231.       IDED_VSPEDIT3);         // ID
  232.  
  233.    wsprintf((LPSTR)cBuff.GetBuffer(9),"%d",m_VSpin3.GetVal());
  234.    m_VSPEdit3.SetWindowText(cBuff);
  235.  
  236.    // Create Spin Button on the Main windlow client area.
  237.    // This will be vertical, using the size 4 predefined bitmaps.
  238.    m_VSpin4.Create(
  239.       BTN_VERT | BTN_SPIN4,         // Vertical size 4
  240.       0,0,0,0,                      // No User Bitmap
  241.       14,100,                       // Spin button position
  242.       0,0,                          // Spin button size (use defaults)
  243.       1,                            // Step value
  244.       0,100,                        // range
  245.       50,                           // Initial value
  246.       150,10,                       // Delay, Speed
  247.       TRUE,                         // Use Hand Cursor
  248.       (UINT)m_hWnd,                 // Parent window handle
  249.       (UINT)IDBN_VSPIN4,            // ID Value
  250.       (UINT)AfxGetInstanceHandle()  // Program instance
  251.    );
  252.  
  253.    // EDIT control to display the above Spin Button value
  254.    m_VSPEdit4.Create(
  255.       WS_CHILD | WS_VISIBLE | WS_BORDER | WS_DISABLED,
  256.       CRect(35,100,67,122),   // Position and Size(35,100,32,22)
  257.       this,                   // Parent window
  258.       IDED_VSPEDIT4);         // ID
  259.  
  260.    wsprintf((LPSTR)cBuff.GetBuffer(9),"%d",m_VSpin4.GetVal());
  261.    m_VSPEdit4.SetWindowText(cBuff);
  262.  
  263.    // Create Spin Button on the Main windlow client area.
  264.    // This will be vertical, using the size 5 predefined bitmaps.
  265.    m_VSpin5.Create(
  266.       BTN_VERT | BTN_SPIN5,         // Vertical size 5
  267.       0,0,0,0,                      // No User Bitmap
  268.       12,130,                       // Spin button position
  269.       0,0,                          // Spin button size (use defaults)
  270.       1,                            // Step value
  271.       0,100,                        // range
  272.       50,                           // Initial value
  273.       150,10,                       // Delay, Speed
  274.       TRUE,                         // Use Hand Cursor
  275.       (UINT)m_hWnd,                 // Parent window handle
  276.       (UINT)IDBN_VSPIN5,            // ID Value
  277.       (UINT)AfxGetInstanceHandle()  // Program instance
  278.    );
  279.  
  280.    // EDIT control to display the above Spin Button value
  281.    m_VSPEdit5.Create(
  282.       WS_CHILD | WS_VISIBLE | WS_BORDER | WS_DISABLED,
  283.       CRect(35,130,67,152),   // Position and Size(35,130,32,22)
  284.       this,                   // Parent window
  285.       IDED_VSPEDIT5);         // ID
  286.  
  287.    wsprintf((LPSTR)cBuff.GetBuffer(9),"%d",m_VSpin5.GetVal());
  288.    m_VSPEdit5.SetWindowText(cBuff);
  289.  
  290.    // Create Spin Button on the Main windlow client area.
  291.    // This will be vertical, using the size 6 predefined bitmaps.
  292.    m_VSpin6.Create(
  293.       BTN_VERT | BTN_SPIN5,         // Vertical size 6
  294.       0,0,0,0,                      // No User Bitmap
  295.       10,160,                       // Spin button position
  296.       0,0,                          // Spin button size (use defaults)
  297.       1,                            // Step value
  298.       0,100,                        // range
  299.       50,                           // Initial value
  300.       150,10,                       // Delay, Speed
  301.       TRUE,                         // Use Hand Cursor
  302.       (UINT)m_hWnd,                 // Parent window handle
  303.       (UINT)IDBN_VSPIN6,            // ID Value
  304.       (UINT)AfxGetInstanceHandle()  // Program instance
  305.    );
  306.  
  307.    // EDIT control to display the above Spin Button value
  308.    m_VSPEdit6.Create(
  309.       WS_CHILD | WS_VISIBLE | WS_BORDER | WS_DISABLED,
  310.       CRect(35,160,67,182),   // Position and Size(35,160,32,22)
  311.       this,                   // Parent window
  312.       IDED_VSPEDIT6);         // ID
  313.  
  314.    wsprintf((LPSTR)cBuff.GetBuffer(9),"%d",m_VSpin6.GetVal());
  315.    m_VSPEdit6.SetWindowText(cBuff);
  316.  
  317.    // Create Spin Button on the Main windlow client area.
  318.    // This will be horizontal, using the size 1 predefined bitmaps.
  319.    m_HSpin1.Create(
  320.       BTN_SPIN1 | BTN_WRAP,         // Horizontal size 1
  321.       0,0,0,0,                      // No User Bitmap
  322.       95,10,                        // Spin button position
  323.       0,0,                          // Spin button size (use defaults)
  324.       1,                            // Step value
  325.       0,100,                        // range
  326.       50,                           // Initial value
  327.       500,150,                      // Delay, Speed
  328.       TRUE,                         // Use Hand Cursor
  329.       (UINT)m_hWnd,                 // Parent window handle
  330.       (UINT)IDBN_HSPIN1,            // ID Value
  331.       (UINT)AfxGetInstanceHandle()  // Program instance
  332.    );
  333.  
  334.    // EDIT control to display the above Spin Button value
  335.    m_HSPEdit1.Create(
  336.       WS_CHILD | WS_VISIBLE | WS_BORDER | WS_DISABLED,
  337.       CRect(115,10,147,32),   // Position and Size(115,10,32,22)
  338.       this,                   // Parent window
  339.       IDED_HSPEDIT1);         // ID
  340.  
  341.    wsprintf((LPSTR)cBuff.GetBuffer(9),"%d",m_HSpin1.GetVal());
  342.    m_HSPEdit1.SetWindowText(cBuff);
  343.  
  344.    // Create Spin Button on the Main windlow client area.
  345.    // This will be horizontal, using the size 2 predefined bitmaps.
  346.    m_HSpin2.Create(
  347.       BTN_SPIN2 | BTN_WRAP,         // Horizontal size 2
  348.       0,0,0,0,                      // No User Bitmap
  349.       93,40,                        // Spin button position
  350.       0,0,                          // Spin button size (use defaults)
  351.       1,                            // Step value
  352.       0,100,                        // range
  353.       50,                           // Initial value
  354.       500,150,                      // Delay, Speed
  355.       TRUE,                         // Use Hand Cursor
  356.       (UINT)m_hWnd,                 // Parent window handle
  357.       (UINT)IDBN_HSPIN2,            // ID Value
  358.       (UINT)AfxGetInstanceHandle()  // Program instance
  359.    );
  360.  
  361.    // EDIT control to display the above Spin Button value
  362.    m_HSPEdit2.Create(
  363.       WS_CHILD | WS_VISIBLE | WS_BORDER | WS_DISABLED,
  364.       CRect(115,40,147,62),   // Position and Size(115,40,32,22)
  365.       this,                   // Parent window
  366.       IDED_HSPEDIT2);         // ID
  367.  
  368.    wsprintf((LPSTR)cBuff.GetBuffer(9),"%d",m_HSpin2.GetVal());
  369.    m_HSPEdit2.SetWindowText(cBuff);
  370.  
  371.    // Create Spin Button on the Main windlow client area.
  372.    // This will be horizontal, using the size 3 predefined bitmaps.
  373.    m_HSpin3.Create(
  374.       BTN_SPIN3 | BTN_WRAP,         // Horizontal size 3
  375.       0,0,0,0,                      // No User Bitmap
  376.       91,70,                        // Spin button position
  377.       0,0,                          // Spin button size (use defaults)
  378.       1,                            // Step value
  379.       0,100,                        // range
  380.       50,                           // Initial value
  381.       500,150,                      // Delay, Speed
  382.       TRUE,                         // Use Hand Cursor
  383.       (UINT)m_hWnd,                 // Parent window handle
  384.       (UINT)IDBN_HSPIN3,            // ID Value
  385.       (UINT)AfxGetInstanceHandle()  // Program instance
  386.    );
  387.  
  388.    // EDIT control to display the above Spin Button value
  389.    m_HSPEdit3.Create(
  390.       WS_CHILD | WS_VISIBLE | WS_BORDER | WS_DISABLED,
  391.       CRect(115,70,147,92),   // Position and Size(115,70,32,22)
  392.       this,                   // Parent window
  393.       IDED_HSPEDIT3);         // ID
  394.  
  395.    wsprintf((LPSTR)cBuff.GetBuffer(9),"%d",m_HSpin3.GetVal());
  396.    m_HSPEdit3.SetWindowText(cBuff);
  397.  
  398.    // Create Spin Button on the Main windlow client area.
  399.    // This will be horizontal, using the size 4 predefined bitmaps.
  400.    m_HSpin4.Create(
  401.       BTN_SPIN4 | BTN_WRAP,         // Horizontal size 4
  402.       0,0,0,0,                      // No User Bitmap
  403.       89,100,                       // Spin button position
  404.       0,0,                          // Spin button size (use defaults)
  405.       1,                            // Step value
  406.       0,100,                        // range
  407.       50,                           // Initial value
  408.       500,150,                      // Delay, Speed
  409.       TRUE,                         // Use Hand Cursor
  410.       (UINT)m_hWnd,                 // Parent window handle
  411.       (UINT)IDBN_HSPIN4,            // ID Value
  412.       (UINT)AfxGetInstanceHandle()  // Program instance
  413.    );
  414.  
  415.    // EDIT control to display the above Spin Button value
  416.    m_HSPEdit4.Create(
  417.       WS_CHILD | WS_VISIBLE | WS_BORDER | WS_DISABLED,
  418.       CRect(115,100,147,122), // Position and Size(115,100,32,22)
  419.       this,                   // Parent window
  420.       IDED_HSPEDIT4);         // ID
  421.  
  422.    wsprintf((LPSTR)cBuff.GetBuffer(9),"%d",m_HSpin4.GetVal());
  423.    m_HSPEdit4.SetWindowText(cBuff);
  424.  
  425.    // Create Spin Button on the Main windlow client area.
  426.    // This will be horizontal, using the size 5 predefined bitmaps.
  427.    m_HSpin5.Create(
  428.       BTN_SPIN5 | BTN_WRAP,         // Horizontal size 5
  429.       0,0,0,0,                      // No User Bitmap
  430.       87,130,                       // Spin button position
  431.       0,0,                          // Spin button size (use defaults)
  432.       1,                            // Step value
  433.       0,100,                        // range
  434.       50,                           // Initial value
  435.       500,150,                      // Delay, Speed
  436.       TRUE,                         // Use Hand Cursor
  437.       (UINT)m_hWnd,                 // Parent window handle
  438.       (UINT)IDBN_HSPIN5,            // ID Value
  439.       (UINT)AfxGetInstanceHandle()  // Program instance
  440.    );
  441.  
  442.    // EDIT control to display the above Spin Button value
  443.    m_HSPEdit5.Create(
  444.       WS_CHILD | WS_VISIBLE | WS_BORDER | WS_DISABLED,
  445.       CRect(115,130,147,152), // Position and Size(115,130,32,22)
  446.       this,                   // Parent window
  447.       IDED_HSPEDIT5);         // ID
  448.  
  449.    wsprintf((LPSTR)cBuff.GetBuffer(9),"%d",m_HSpin5.GetVal());
  450.    m_HSPEdit5.SetWindowText(cBuff);
  451.  
  452.    // Create Spin Button on the Main windlow client area.
  453.    // This will be horizontal, using the size 6 predefined bitmaps.
  454.    m_HSpin6.Create(
  455.       BTN_SPIN6 | BTN_WRAP,         // Horizontal size 6
  456.       0,0,0,0,                      // No User Bitmap
  457.       85,160,                       // Spin button position
  458.       0,0,                          // Spin button size (use defaults)
  459.       1,                            // Step value
  460.       0,100,                        // range
  461.       50,                           // Initial value
  462.       500,150,                      // Delay, Speed
  463.       TRUE,                         // Use Hand Cursor
  464.       (UINT)m_hWnd,                 // Parent window handle
  465.       (UINT)IDBN_HSPIN6,            // ID Value
  466.       (UINT)AfxGetInstanceHandle()  // Program instance
  467.    );
  468.  
  469.    // EDIT control to display the above Spin Button value
  470.    m_HSPEdit6.Create(
  471.       WS_CHILD | WS_VISIBLE | WS_BORDER | WS_DISABLED,
  472.       CRect(115,160,147,182), // Position and Size(115,160,32,22)
  473.       this,                   // Parent window
  474.       IDED_HSPEDIT6);         // ID
  475.  
  476.    wsprintf((LPSTR)cBuff.GetBuffer(9),"%d",m_HSpin6.GetVal());
  477.    m_HSPEdit6.SetWindowText(cBuff);
  478.  
  479.    // This is a 2-State Toggle Switch located directly beneath the
  480.    // 6 vertical spin button.  It is used as a switch to enable and
  481.    // disable the vertical spin buttons.
  482.    m_NFTSw.Create(
  483.       BTN_T2S,                      // 2-State Toggle Button Type
  484.       (LPSTR)IDB_NFTLO,             // Bitmap name for state 1 position
  485.       (LPSTR)IDB_NFTHI,             // Bitmap name for state 2 position
  486.       (LPSTR)IDB_NFTLOG,            // Bitmap name for disabled state 1 position
  487.       (LPSTR)IDB_NFTHIG,            // Bitmap name for disabled state 2 position
  488.       15,200,                       // Button position
  489.       0,0,                          // Button size (use bitmap size)
  490.       1,                            // Step value
  491.       0,1,                          // Range
  492.       1,                            // Initial value
  493.       1,1,                          // Delay, Speed  (Ingore by this type anyway)
  494.       TRUE,                         // Use Hand Cursor
  495.       (UINT)m_hWnd,                 // Parent window handle
  496.       (UINT)IDBN_NFTSW,             // ID Value
  497.       (UINT)AfxGetInstanceHandle()  // Program instance
  498.    );
  499.  
  500.    // This User defined Spin Button used to look simulate a 2-State
  501.    // Momentary Toggle Switch located directly beneath the 6 horizontal
  502.    // Spin buttons.  It is used as a switch to enable and
  503.    // disable the horizontal spin buttons.
  504.    m_Switch1.Create(
  505.       BTN_SPINU,                    // User defined Spin Button Type
  506.       (LPSTR)IDB_SWITCH1,           // Bitmap name for Unpushed State
  507.       (LPSTR)IDB_SWITCH1N,          // Bitmap name for Incrementing State
  508.       (LPSTR)IDB_SWITCH1F,          // Bitmap name for Decrementing State
  509.       0,                            // No Bitmap for Disabled State
  510.       90,200,                       // Button position
  511.       0,0,                          // Button size (use bitmap size)
  512.       1,                            // Step value
  513.       0,1,                          // Range
  514.       1,                            // Initial value
  515.       1,1,                          // Delay, Speed
  516.       FALSE,                        // Use Arrow Cursor
  517.       (UINT)m_hWnd,                 // Parent window handle
  518.       (UINT)IDBN_SWITCH1,           // ID Value
  519.       (UINT)AfxGetInstanceHandle()  // Program instance
  520.    );
  521.  
  522.    // Create a Red Color Button on the Main windlow client area.
  523.    m_RedBut.Create(
  524.       BTN_RED,                      // Red Color Button Type
  525.       0,0,0,0,                      // No Bitmaps
  526.       180,10,                       // Button position
  527.       15,15,                        // Button size
  528.       0,                            // No Step Value
  529.       0,0,                          // No Range
  530.       0,                            // No Initial value
  531.       1,1,                          // Delay, Speed  (Ingore by this type anyway)
  532.       TRUE,                         // Use Hand Cursor
  533.       (UINT)m_hWnd,                 // Parent window handle
  534.       IDBN_REDBUTTON,               // ID Value
  535.       (UINT)AfxGetInstanceHandle()  // Program instance
  536.    );
  537.  
  538.    // Create a Green Color Button on the Main windlow client area.
  539.    m_GrnBut.Create(
  540.       BTN_GRN,                      // Green Color Button Type
  541.       0,0,0,0,                      // No Bitmaps
  542.       205,10,                       // Button position
  543.       15,15,                        // Button size
  544.       0,                            // No Step Value
  545.       0,0,                          // No Range
  546.       0,                            // No Initial value
  547.       1,1,                          // Delay, Speed  (Ingore by this type anyway)
  548.       TRUE,                         // Use Hand Cursor
  549.       (UINT)m_hWnd,                 // Parent window handle
  550.       IDBN_GRNBUTTON,               // ID Value
  551.       (UINT)AfxGetInstanceHandle()  // Program instance
  552.    );
  553.  
  554.    // Create a Blue Color Button on the Main windlow client area.
  555.    m_BluBut.Create(
  556.       BTN_BLU,                      // Blue Color Button Type
  557.       0,0,0,0,                      // No Bitmaps
  558.       230,10,                       // Button position
  559.       15,15,                        // Button size
  560.       0,                            // No Step Value
  561.       0,0,                          // No Range
  562.       0,                            // No Initial value
  563.       1,1,                          // Delay, Speed  (Ingore by this type anyway)
  564.       TRUE,                         // Use Hand Cursor
  565.       (UINT)m_hWnd,                 // Parent window handle
  566.       IDBN_BLUBUTTON,               // ID Value
  567.       (UINT)AfxGetInstanceHandle()  // Program instance
  568.    );
  569.  
  570.    // Create a Yellow Color Button on the Main windlow client area.
  571.    m_YelBut.Create(
  572.       BTN_YEL,                      // Yellow Color Button Type
  573.       0,0,0,0,                      // No Bitmaps
  574.       255,10,                       // Button position
  575.       15,15,                        // Button size
  576.       0,                            // No Step Value
  577.       0,0,                          // No Range
  578.       0,                            // No Initial value
  579.       1,1,                          // Delay, Speed  (Ingore by this type anyway)
  580.       TRUE,                         // Use Hand Cursor
  581.       (UINT)m_hWnd,                 // Parent window handle
  582.       IDBN_YELBUTTON,               // ID Value
  583.       (UINT)AfxGetInstanceHandle()  // Program instance
  584.    );
  585.  
  586.    // Create a Cyan Color Button on the Main windlow client area.
  587.    m_CynBut.Create(
  588.       BTN_CYN,                      // Cyan Color Button Type
  589.       0,0,0,0,                      // No Bitmaps
  590.       280,10,                       // Button position
  591.       15,15,                        // Button size
  592.       0,                            // No Step Value
  593.       0,0,                          // No Range
  594.       0,                            // No Initial value
  595.       1,1,                          // Delay, Speed  (Ingore by this type anyway)
  596.       TRUE,                         // Use Hand Cursor
  597.       (UINT)m_hWnd,                 // Parent window handle
  598.       IDBN_CYNBUTTON,               // ID Value
  599.       (UINT)AfxGetInstanceHandle()  // Program instance
  600.    );
  601.  
  602.    // Create a Magenta Color Button on the Main windlow client area.
  603.    m_MagBut.Create(
  604.       BTN_MAG,                      // Magenta Color Button Type
  605.       0,0,0,0,                      // No Bitmaps
  606.       305,10,                       // Button position
  607.       15,15,                        // Button size
  608.       0,                            // No Step Value
  609.       0,0,                          // No Range
  610.       0,                            // No Initial value
  611.       1,1,                          // Delay, Speed  (Ingore by this type anyway)
  612.       TRUE,                         // Use Hand Cursor
  613.       (UINT)m_hWnd,                 // Parent window handle
  614.       IDBN_MAGBUTTON,               // ID Value
  615.       (UINT)AfxGetInstanceHandle()  // Program instance
  616.    );
  617.  
  618.    // Create a Gray Color Button on the Main windlow client area.
  619.    m_GryBut.Create(
  620.       BTN_GRY,                      // Gray Color Button Type
  621.       0,0,0,0,                      // No Bitmaps
  622.       330,10,                       // Button position
  623.       15,15,                        // Button size
  624.       0,                            // No Step Value
  625.       0,0,                          // No Range
  626.       0,                            // No Initial value
  627.       1,1,                          // Delay, Speed  (Ingore by this type anyway)
  628.       TRUE,                         // Use Hand Cursor
  629.       (UINT)m_hWnd,                 // Parent window handle
  630.       (UINT)IDBN_GRYBUTTON,         // ID Value
  631.       (UINT)AfxGetInstanceHandle()  // Program instance
  632.    );
  633.  
  634.    // Create a Black Color Button on the Main windlow client area.
  635.    m_BlkBut.Create(
  636.       BTN_BLK,                      // Black Color Button Type
  637.       0,0,0,0,                      // No Bitmaps
  638.       355,10,                       // Button position
  639.       15,15,                        // Button size
  640.       0,                            // No Step Value
  641.       0,0,                          // No Range
  642.       0,                            // No Initial value
  643.       1,1,                          // Delay, Speed  (Ingore by this type anyway)
  644.       TRUE,                         // Use Hand Cursor
  645.       (UINT)m_hWnd,                 // Parent window handle
  646.       IDBN_BLKBUTTON,               // ID Value
  647.       (UINT)AfxGetInstanceHandle()  // Program instance
  648.    );
  649.  
  650.    // Create Spin Button for the fancy looking Volume Control
  651.    m_Volume.Create(
  652.       BTN_SPINU,                    // User defined Spin Button Type
  653.       (LPSTR)IDB_VOLUME,            // Bitmap name for Unpushed State
  654.       (LPSTR)IDB_VOLUMEI,           // Bitmap name for Incrementing State
  655.       (LPSTR)IDB_VOLUMED,           // Bitmap name for Decrementing State
  656.       (LPSTR)IDB_VOLUMEG,           // Bitmap name for Disabled State
  657.       200,100,                      // Button position
  658.       0,0,                          // Button size (use bitmap size)
  659.       1,                            // Step value
  660.       0,100,                        // Range
  661.       0,                            // Initial value
  662.       200,100,                      // Delay, Speed
  663.       TRUE,                         // Use Hand Cursor
  664.       (UINT)m_hWnd,                 // Parent window handle
  665.       (UINT)IDBN_VOLUME,            // ID Value
  666.       (UINT)AfxGetInstanceHandle()  // Program instance
  667.    );
  668.  
  669.    // Create EDIT control to display the above Spin Button value
  670.    m_VEdit.Create(
  671.       WS_CHILD | WS_VISIBLE | WS_BORDER | WS_DISABLED,
  672.       CRect(200,77,247,99),    // Position and Size(200,77,47,22)
  673.       this,                   // Parent window
  674.       IDED_VEDIT);            // ID
  675.  
  676.    wsprintf((LPSTR)cBuff.GetBuffer(9),"%d",m_Volume.GetVal());
  677.    m_VEdit.SetWindowText(cBuff);
  678.  
  679.    // Create 2-State Push Button That will enable and disable
  680.    // the fancy looking Volume Control
  681.    m_Voled.Create(
  682.       BTN_P2S,                      // 2-State Push Button Type
  683.       (LPSTR)IDB_VOLD,              // Bitmap name for Unpushed State 1
  684.       (LPSTR)IDB_VOLE,              // Bitmap name for Unpushed State 2
  685.       (LPSTR)IDB_VOLP,              // Bitmap name for Pushed State      
  686.       "0",                          // No Bitmap for Disabled State
  687.       200,121,                      // Button position
  688.       0,0,                          // Button size (use bitmap size)
  689.       1,                            // Step value
  690.       0,1,                          // Range
  691.       1,                            // Initial value
  692.       1,1,                          // Delay, Speed  (Ingore by this type anyway)
  693.       TRUE,                         // Use Hand Cursor
  694.       (UINT)m_hWnd,                 // Parent window handle
  695.       (UINT)IDBN_VOLED,             // ID Value
  696.       (UINT)AfxGetInstanceHandle()  // Program instance
  697.    );
  698.  
  699.    return 0;
  700.  
  701. }  // END WM_CREATE
  702.  
  703. //***************************************************************************
  704. //
  705. //  Main Window WM_COMMAMD:ID_ABOUT Command Message Handler
  706. //
  707. //***************************************************************************
  708. void CMainWnd::OnAbout()
  709. {
  710.  
  711.    CDialog about(IDD_ABOUTBOX);
  712.    about.DoModal();
  713.  
  714. } // End CMainWnd::OnAbout
  715.  
  716. //***************************************************************************
  717. //
  718. //  Main Window WM_COMMAMD:VSPIN1 Command Message Handler
  719. //
  720. //***************************************************************************
  721. void CMainWnd::OnVSpin1()
  722. {
  723.  
  724.    wsprintf((LPSTR)cBuff.GetBuffer(9),"%d",m_VSpin1.GetVal());
  725.    m_VSPEdit1.SetWindowText(cBuff);
  726.    m_VSPEdit1.UpdateWindow();
  727.  
  728. } // End CMainWnd::OnVSpin1
  729.  
  730. //***************************************************************************
  731. //
  732. //  Main Window WM_COMMAMD:VSPIN2 Command Message Handler
  733. //
  734. //***************************************************************************
  735. void CMainWnd::OnVSpin2()
  736. {
  737.  
  738.    wsprintf((LPSTR)cBuff.GetBuffer(9),"%d",m_VSpin2.GetVal());
  739.    m_VSPEdit2.SetWindowText(cBuff);
  740.    m_VSPEdit2.UpdateWindow();
  741.  
  742. } // End CMainWnd::OnVSpin2
  743.  
  744. //***************************************************************************
  745. //
  746. //  Main Window WM_COMMAMD:VSPIN3 Command Message Handler
  747. //
  748. //***************************************************************************
  749. void CMainWnd::OnVSpin3()
  750. {
  751.  
  752.    wsprintf((LPSTR)cBuff.GetBuffer(9),"%d",m_VSpin3.GetVal());
  753.    m_VSPEdit3.SetWindowText(cBuff);
  754.    m_VSPEdit3.UpdateWindow();
  755.  
  756. } // End CMainWnd::OnVSpin3
  757.  
  758. //***************************************************************************
  759. //
  760. //  Main Window WM_COMMAMD:VSPIN4 Command Message Handler
  761. //
  762. //***************************************************************************
  763. void CMainWnd::OnVSpin4()
  764. {
  765.  
  766.    wsprintf((LPSTR)cBuff.GetBuffer(9),"%d",m_VSpin4.GetVal());
  767.    m_VSPEdit4.SetWindowText(cBuff);
  768.    m_VSPEdit4.UpdateWindow();
  769.  
  770. } // End CMainWnd::OnVSpin4
  771.  
  772. //***************************************************************************
  773. //
  774. //  Main Window WM_COMMAMD:VSPIN5 Command Message Handler
  775. //
  776. //***************************************************************************
  777. void CMainWnd::OnVSpin5()
  778. {
  779.  
  780.    wsprintf((LPSTR)cBuff.GetBuffer(9),"%d",m_VSpin5.GetVal());
  781.    m_VSPEdit5.SetWindowText(cBuff);
  782.    m_VSPEdit5.UpdateWindow();
  783.  
  784. } // End CMainWnd::OnVSpin5
  785.  
  786. //***************************************************************************
  787. //
  788. //  Main Window WM_COMMAMD:VSPIN6 Command Message Handler
  789. //
  790. //***************************************************************************
  791. void CMainWnd::OnVSpin6()
  792. {
  793.  
  794.    wsprintf((LPSTR)cBuff.GetBuffer(9),"%d",m_VSpin6.GetVal());
  795.    m_VSPEdit6.SetWindowText(cBuff);
  796.    m_VSPEdit6.UpdateWindow();
  797.  
  798. } // End CMainWnd::OnVSpin6
  799.  
  800. //***************************************************************************
  801. //
  802. //  Main Window WM_COMMAMD:HSPIN1 Command Message Handler
  803. //
  804. //***************************************************************************
  805. void CMainWnd::OnHSpin1()
  806. {
  807.  
  808.    wsprintf((LPSTR)cBuff.GetBuffer(9),"%d",m_HSpin1.GetVal());
  809.    m_HSPEdit1.SetWindowText(cBuff);
  810.    m_HSPEdit1.UpdateWindow();
  811.  
  812. } // End CMainWnd::OnHSpin1
  813.  
  814. //***************************************************************************
  815. //
  816. //  Main Window WM_COMMAMD:HSPIN2 Command Message Handler
  817. //
  818. //***************************************************************************
  819. void CMainWnd::OnHSpin2()
  820. {
  821.  
  822.    wsprintf((LPSTR)cBuff.GetBuffer(9),"%d",m_HSpin2.GetVal());
  823.    m_HSPEdit2.SetWindowText(cBuff);
  824.    m_HSPEdit2.UpdateWindow();
  825.  
  826. } // End CMainWnd::OnHSpin2
  827.  
  828. //***************************************************************************
  829. //
  830. //  Main Window WM_COMMAMD:HSPIN3 Command Message Handler
  831. //
  832. //***************************************************************************
  833. void CMainWnd::OnHSpin3()
  834. {
  835.  
  836.    wsprintf((LPSTR)cBuff.GetBuffer(9),"%d",m_HSpin3.GetVal());
  837.    m_HSPEdit3.SetWindowText(cBuff);
  838.    m_HSPEdit3.UpdateWindow();
  839.  
  840. } // End CMainWnd::OnHSpin3
  841.  
  842. //***************************************************************************
  843. //
  844. //  Main Window WM_COMMAMD:HSPIN4 Command Message Handler
  845. //
  846. //***************************************************************************
  847. void CMainWnd::OnHSpin4()
  848. {
  849.  
  850.    wsprintf((LPSTR)cBuff.GetBuffer(9),"%d",m_HSpin4.GetVal());
  851.    m_HSPEdit4.SetWindowText(cBuff);
  852.    m_HSPEdit4.UpdateWindow();
  853.  
  854. } // End CMainWnd::OnHSpin4
  855.  
  856. //***************************************************************************
  857. //
  858. //  Main Window WM_COMMAMD:HSPIN5 Command Message Handler
  859. //
  860. //***************************************************************************
  861. void CMainWnd::OnHSpin5()
  862. {
  863.  
  864.    wsprintf((LPSTR)cBuff.GetBuffer(9),"%d",m_HSpin5.GetVal());
  865.    m_HSPEdit5.SetWindowText(cBuff);
  866.    m_HSPEdit5.UpdateWindow();
  867.  
  868. } // End CMainWnd::OnHSpin5
  869.  
  870. //***************************************************************************
  871. //
  872. //  Main Window WM_COMMAMD:HSPIN6 Command Message Handler
  873. //
  874. //***************************************************************************
  875. void CMainWnd::OnHSpin6()
  876. {
  877.  
  878.    wsprintf((LPSTR)cBuff.GetBuffer(9),"%d",m_HSpin6.GetVal());
  879.    m_HSPEdit6.SetWindowText(cBuff);
  880.    m_HSPEdit6.UpdateWindow();
  881.  
  882. } // End CMainWnd::OnHSpin6
  883.  
  884. //***************************************************************************
  885. //
  886. //  Main Window WM_COMMAMD:NFTSW Command Message Handler
  887. //
  888. //***************************************************************************
  889. void CMainWnd::OnNFTSw()
  890. {
  891.  
  892.    // 2-State Toggle Switch that disables and disables the 
  893.    // vertical spin buttons.
  894.    if (m_NFTSw.GetVal())  // Enable Vertical Spin Buttons
  895.    {
  896.       m_VSpin1.Enable(TRUE);
  897.       m_VSpin2.Enable(TRUE);
  898.       m_VSpin3.Enable(TRUE);
  899.       m_VSpin4.Enable(TRUE);
  900.       m_VSpin5.Enable(TRUE);
  901.       m_VSpin6.Enable(TRUE);
  902.    }
  903.    else   // Disable Vertical Spin Buttons
  904.    {
  905.       m_VSpin1.Enable(FALSE);
  906.       m_VSpin2.Enable(FALSE);
  907.       m_VSpin3.Enable(FALSE);
  908.       m_VSpin4.Enable(FALSE);
  909.       m_VSpin5.Enable(FALSE);
  910.       m_VSpin6.Enable(FALSE);
  911.    }
  912.  
  913. } // End CMainWnd::OnNFTSw
  914.  
  915. //***************************************************************************
  916. //
  917. //  Main Window WM_COMMAMD:SWITCH1 Command Message Handler
  918. //
  919. //***************************************************************************
  920. void CMainWnd::OnSwitch1()
  921. {
  922.  
  923.    // Spin Button that similates a 2-State Momentary Toggle Switch that
  924.    // disables and disables the horizontal spin buttons.
  925.    if (m_Switch1.GetVal())  // Enable Horizontal Spin Buttons
  926.    {
  927.       m_HSpin1.Enable(TRUE);
  928.       m_HSpin2.Enable(TRUE);
  929.       m_HSpin3.Enable(TRUE);
  930.       m_HSpin4.Enable(TRUE);
  931.       m_HSpin5.Enable(TRUE);
  932.       m_HSpin6.Enable(TRUE);
  933.    }
  934.    else   // Disable Horizontal Spin Buttons
  935.    {
  936.       m_HSpin1.Enable(FALSE);
  937.       m_HSpin2.Enable(FALSE);
  938.       m_HSpin3.Enable(FALSE);
  939.       m_HSpin4.Enable(FALSE);
  940.       m_HSpin5.Enable(FALSE);
  941.       m_HSpin6.Enable(FALSE);
  942.    }
  943.  
  944. } // End CMainWnd::OnSwitch1
  945.  
  946. //***************************************************************************
  947. //
  948. //  Main Window WM_COMMAMD:REDBUTTON Command Message Handler
  949. //
  950. //***************************************************************************
  951. void CMainWnd::OnRedBut()
  952. {
  953.  
  954.    TextColor = RGB(255,0,0);
  955.    InvalidateRect(NULL,FALSE);
  956.  
  957. } // End CMainWnd::OnRedBut
  958.  
  959. //***************************************************************************
  960. //
  961. //  Main Window WM_COMMAMD:GRNBUTTON Command Message Handler
  962. //
  963. //***************************************************************************
  964. void CMainWnd::OnGrnBut()
  965. {
  966.  
  967.    TextColor = RGB(0,255,0);
  968.    InvalidateRect(NULL,FALSE);
  969.  
  970. } // End CMainWnd::OnGrnBut
  971.  
  972. //***************************************************************************
  973. //
  974. //  Main Window WM_COMMAMD:BLUBUTTON Command Message Handler
  975. //
  976. //***************************************************************************
  977. void CMainWnd::OnBluBut()
  978. {
  979.  
  980.    TextColor = RGB(0,0,255);
  981.    InvalidateRect(NULL,FALSE);
  982.  
  983. } // End CMainWnd::OnBluBut
  984.  
  985. //***************************************************************************
  986. //
  987. //  Main Window WM_COMMAMD:YELBUTTON Command Message Handler
  988. //
  989. //***************************************************************************
  990. void CMainWnd::OnYelBut()
  991. {
  992.  
  993.    TextColor = RGB(255,255,0);
  994.    InvalidateRect(NULL,FALSE);
  995.  
  996. } // End CMainWnd::OnYelBut
  997.  
  998. //***************************************************************************
  999. //
  1000. //  Main Window WM_COMMAMD:CYNBUTTON Command Message Handler
  1001. //
  1002. //***************************************************************************
  1003. void CMainWnd::OnCynBut()
  1004. {
  1005.  
  1006.    TextColor = RGB(0,255,255);
  1007.    InvalidateRect(NULL,FALSE);
  1008.  
  1009. } // End CMainWnd::OnCynBut
  1010.  
  1011. //***************************************************************************
  1012. //
  1013. //  Main Window WM_COMMAMD:MAGBUTTON Command Message Handler
  1014. //
  1015. //***************************************************************************
  1016. void CMainWnd::OnMagBut()
  1017. {
  1018.  
  1019.    TextColor = RGB(255,0,255);
  1020.    InvalidateRect(NULL,FALSE);
  1021.  
  1022. } // End CMainWnd::OnMagBut
  1023.  
  1024. //***************************************************************************
  1025. //
  1026. //  Main Window WM_COMMAMD:GRYBUTTON Command Message Handler
  1027. //
  1028. //***************************************************************************
  1029. void CMainWnd::OnGryBut()
  1030. {
  1031.  
  1032.    TextColor = RGB(128,128,128);
  1033.    InvalidateRect(NULL,FALSE);
  1034.  
  1035. } // End CMainWnd::OnGryBut
  1036.  
  1037. //***************************************************************************
  1038. //
  1039. //  Main Window WM_COMMAMD:BLKBUTTON Command Message Handler
  1040. //
  1041. //***************************************************************************
  1042. void CMainWnd::OnBlkBut()
  1043. {
  1044.  
  1045.    TextColor = RGB(0,0,0);
  1046.    InvalidateRect(NULL,FALSE);
  1047.  
  1048. } // End CMainWnd::OnBlkBut
  1049.  
  1050. //***************************************************************************
  1051. //
  1052. //  Main Window WM_COMMAMD:VOLUME Command Message Handler
  1053. //
  1054. //***************************************************************************
  1055. void CMainWnd::OnVolume()
  1056. {
  1057.  
  1058.    wsprintf((LPSTR)cBuff.GetBuffer(9),"%d",m_Volume.GetVal());
  1059.    m_VEdit.SetWindowText(cBuff);
  1060.    m_VEdit.UpdateWindow();
  1061.  
  1062. } // End CMainWnd::OnVolume
  1063.  
  1064. //***************************************************************************
  1065. //
  1066. //  Main Window WM_COMMAMD:VOLED Command Message Handler
  1067. //
  1068. //***************************************************************************
  1069. void CMainWnd::OnVoled()
  1070. {
  1071.  
  1072.    if (m_Voled.GetVal())
  1073.       m_Volume.Enable(TRUE);
  1074.    else
  1075.       m_Volume.Enable(FALSE);
  1076.  
  1077. } // End CMainWnd::OnVoled
  1078.  
  1079. //***************************************************************************
  1080. //
  1081. //  Main Window WM_COMMAMD:PAINT Command Message Handler
  1082. //
  1083. //***************************************************************************
  1084. void CMainWnd::OnPaint()
  1085. {
  1086.  
  1087.    CPaintDC dc(this);
  1088.    
  1089.    dc.SetBkColor(RGB(192,192,192));
  1090.    dc.SetTextColor(TextColor);
  1091.    dc.TextOut(160,30,"Change Text Color With Color Button",35);
  1092.  
  1093. } // End CMainWnd::OnPaint
  1094.  
  1095. //**** End Application's Main Window Class Implementation *******************
  1096. //***************************************************************************
  1097. //***************************************************************************
  1098.  
  1099. //***************************************************************************
  1100. //***************************************************************************
  1101. // Begin Application Execution
  1102. //***************************************************************************
  1103. //***************************************************************************
  1104.  
  1105. //***************************************************************************
  1106. //
  1107. //  Global Data
  1108. //
  1109. //***************************************************************************
  1110.  
  1111. // By declaring a global application object, the whole application runs
  1112. CTheApp NEAR theApp;
  1113.