home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / dovetail.zip / dove.cc < prev    next >
C/C++ Source or Header  |  1994-04-06  |  4KB  |  92 lines

  1.  
  2. //**************************************************************************
  3. #include <stdlib.h>
  4. #include "process.h"
  5. #include "dove.h"
  6. //**************************************************************************
  7.  
  8. extern "C"
  9.    {
  10.     MRESULT ClientWndProc (HWND, USHORT, MPARAM, MPARAM);
  11.    }
  12.  
  13. //  ********* Global Variables *********************************************
  14.  
  15. Process        Proc;
  16. float fLength = 5.5*25.4,fThickness=.75*25.4;
  17. float fSlope=8.,fTailPinRatio=1.,fMidEdgeRatio=1.,fEndPinSize=.75;
  18. int iMultOrAdd=1,iNumTails=3;
  19. int old_unit = 0;
  20. HWND hMain=0;
  21. int ok_to_post = 0;
  22. HWND     hwndFrame;
  23.  
  24. // *************************************************************************
  25.  
  26. int     main (int       argc,
  27.               char *    argv[])
  28.  
  29.   {//  Variable Declarations
  30.  
  31.    static  ULONG    flFrameFlags = FCF_TITLEBAR       |
  32.                                    FCF_SYSMENU        |
  33.                                    FCF_SIZEBORDER     |
  34.                                    FCF_MINMAX         |
  35.                                    FCF_SHELLPOSITION  |
  36.                                    FCF_TASKLIST       |
  37.                               //   FCF_VERTSCROLL     |
  38.                               //   FCF_HORZSCROLL     |
  39.                                    FCF_MENU           |
  40.                                    FCF_ICON;
  41.            HWND     hwndClient;
  42.    static  CHAR     szTitleBarText[] = "Dovetail Designer: No name";
  43.            QMSG     QueMsg;
  44.    static  CHAR     szPrvtWinClass[] = "Private Class";
  45.  
  46.    //  Register a private window class for this application.
  47.  
  48.    WinRegisterClass (Proc.AnchorBlock(),  // Anchor Block handle
  49.                (PSZ) szPrvtWinClass,      // Name of window class
  50.              (PFNWP) ClientWndProc,       // Window procedure for class   
  51.                      CS_SIZEREDRAW |
  52.                      CS_CLIPCHILDREN,       // Set redraw on window resize
  53.                      0);                  // Extra bytes to reserve       
  54.  
  55.    //  Create a standard window frame.
  56.  
  57.    hwndFrame = WinCreateStdWindow (HWND_DESKTOP,         // Create a parent window                
  58.                                    WS_VISIBLE      |     // Make the window visible               
  59.                             //         FS_ACCELTABLE |     // Use accelerator table
  60.                                      FS_ICON,            // Use Icon                            
  61.                                    &flFrameFlags,        // Creation flags                        
  62.                              (PSZ) szPrvtWinClass,       // window class name                     
  63.                              (PSZ) szTitleBarText,       // Title bar text                        
  64.                                    0L,                   // Style of client window                
  65.                          (HMODULE) NULL,                 // Resource is in application module     
  66.                                    ID_RESOURCE,          // ID of resources for this frame window 
  67.                                    &hwndClient);         // Returned client window handle         
  68.     hMain = hwndClient;
  69.    //  Standard message processing loop. WinGetMsg returns FALSE if the  
  70.    //  returned message is WM_QUIT.  Returns TRUE for all other messages 
  71.  
  72.    while (WinGetMsg (Proc.AnchorBlock(),   // Anchor block handle                 
  73.                      &QueMsg,            // Pointer to queue message structure  
  74.                      0,               // No window message filter            
  75.                      0,                  // Retrieve all messages               
  76.                      0))                 // Retrieve all messages               
  77.      {WinDispatchMsg(Proc.AnchorBlock(),   // Anchor block handle       
  78.                      &QueMsg);           // structure holding message 
  79.      }
  80.  
  81.    //  The WM_QUIT message has been received.  Destroy window.  Destroy  
  82.    //  message queue.  Let go of anchor block.                           
  83.  
  84.    WinDestroyWindow(hwndFrame);
  85.  
  86.    //  Terminate program. 
  87.  
  88.    return 0;
  89.  
  90.   }
  91.  
  92.