home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / bmp4.zip / MAKEPTR.C < prev    next >
C/C++ Source or Header  |  1995-11-07  |  4KB  |  105 lines

  1. #pragma    title("Pointer Creation Tool  --  Version 1  --  (MakePtr.C)")
  2. #pragma    subtitle("   main( ) - Interface Definitions")
  3.  
  4. #pragma    info(noext, nopar)
  5.  
  6. #define    INCL_DOS           /* Include OS/2 DOS Kernal        */
  7. #define    INCL_WIN           /* Include OS/2 PM Windows Interface    */
  8.  
  9. #include <os2.h>
  10.  
  11. #include "appdefs.h"
  12. #include "makeptr.h"
  13.  
  14. /* This    module contains    routine    used to    contain    the main entry point to    */
  15. /* the application.                            */
  16.  
  17. /* Filename:   MakePtr.C                        */
  18.  
  19. /*  Version:   1                            */
  20. /*  Created:   1995-11-06                        */
  21. /*  Revised:   1995-11-06                        */
  22.  
  23. /* Routines:   INT main(INT argc, CHAR *argv[ ]);            */
  24.  
  25.  
  26. /************************************************************************/
  27. /************************************************************************/
  28. /************************************************************************/
  29. /* DISCLAIMER OF WARRANTIES:                        */
  30. /* -------------------------                        */
  31. /* The following [enclosed] code is sample code    created    by IBM        */
  32. /* Corporation and Prominare Inc.  This    sample code is not part    of any    */
  33. /* standard IBM    product    and is provided    to you solely for the purpose    */
  34. /* of assisting    you in the development of your applications.  The code    */
  35. /* is provided "AS IS",    without    warranty of any    kind.  Neither IBM nor    */
  36. /* Prominare shall be liable for any damages arising out of your    */
  37. /* use of the sample code, even    if they    have been advised of the    */
  38. /* possibility of such damages.                        */
  39. /************************************************************************/
  40. /************************************************************************/
  41. /************************************************************************/
  42. /*               D I S C L A I M E R                */
  43. /* This    code is    provided on an as is basis with    no implied support.    */
  44. /* It should be    considered freeware that cannot    be rebundled as        */
  45. /* part    of a larger "*ware" offering without our consent.        */
  46. /************************************************************************/
  47. /************************************************************************/
  48. /************************************************************************/
  49.  
  50. /* Copyright ╕ International Business Machines Corp., 1995.        */
  51. /* Copyright ╕ 1995  Prominare Inc.  All Rights    Reserved.        */
  52.  
  53. /* --------------------------------------------------------------------    */
  54.  
  55. PSZ pszMakePtrClassName    = (PSZ)"MakePtr";
  56.  
  57.  
  58. INT main(INT argc, CHAR    *argv[ ])
  59.  
  60. {
  61. QMSG  qmsg;               /* PM Message Queue Holder        */
  62.  
  63.                /* Initialize the program for PM    and create the    */
  64.                /* message queue                    */
  65.  
  66. hmqMakePtr = WinCreateMsgQueue(hAB = WinInitialize(0UL), 0L);
  67.  
  68.                /* Register the window class            */
  69.  
  70. if ( !WinRegisterClass(hAB, pszMakePtrClassName, (PFNWP)ViewWndProc,  CS_SYNCPAINT | CS_SIZEREDRAW, 8UL) )
  71.    return(0);
  72.                /* Create the main program window        */
  73.  
  74. if ( !(hwndMakePtrFrame = CreateStdWindow(HWND_DESKTOP, WS_VISIBLE,
  75.                                           FCF_NOBYTEALIGN | FCF_TASKLIST | 
  76.                                           FCF_TITLEBAR | FCF_ICON | FCF_SYSMENU | 
  77.                                           FCF_MENU | FCF_MINMAX | 
  78.                                           FCF_SIZEBORDER,
  79.                                           pszMakePtrClassName, (PSZ)"Pointer Creation Tool", 0L,
  80.                                           (HMODULE)NULL, WIN_MAKEPTR, &hwndMakePtr, 10, 31, 226, 101)) )
  81.    return(0);
  82.  
  83. InitApp(hwndMakePtrFrame, hwndMakePtr, NULL);
  84.  
  85.                /* Get and dispatch the message to program    */
  86.                /* windows                    */
  87.  
  88. while (    WinGetMsg(hAB, &qmsg, (HWND)NULL, 0UL, 0UL) )
  89.    WinDispatchMsg(hAB, &qmsg);
  90.  
  91.                /* Have received    a WM_QUIT, start the program    */
  92.                /* shutdown by destroying the program windows    */
  93.                /* and destroying the message queue        */
  94.  
  95. WinDestroyWindow(hwndMakePtrFrame);
  96.  
  97. WinDestroyMsgQueue(hmqMakePtr);
  98.  
  99.                /* Notify PM that main program thread not needed    */
  100.                /* any longer                    */
  101. WinTerminate(hAB);
  102.                /* Exit back to OS/2 cleanly            */
  103. return(0);
  104. }
  105.