home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / bmp3.zip / VIEWICO.C < prev    next >
C/C++ Source or Header  |  1995-10-18  |  4KB  |  104 lines

  1. #pragma    title("Icon/Pointer Viewer  --  Version 1  --  (ViewIco.C)")
  2. #pragma    subtitle("   Module Purpose - 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 "viewico.h"
  13.  
  14. /* This    module contains    routine    used to    contain    the main entry point to    */
  15. /* the application.                            */
  16.  
  17. /* Filename:   ViewIco.C                        */
  18.  
  19. /*  Version:   1                            */
  20. /*  Created:   1995-10-18                        */
  21. /*  Revised:   1995-10-18                        */
  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 pszViewClassName = (PSZ)"ROPs";
  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. hmqView    = WinCreateMsgQueue(hAB    = WinInitialize(0UL), 0L);
  67.  
  68.                /* Register the window class            */
  69.  
  70. if ( !WinRegisterClass(hAB, pszViewClassName, (PFNWP)ViewWndProc, CS_SYNCPAINT | CS_SIZEREDRAW,    8UL) )
  71.    return(0);
  72.                /* Create the main program window        */
  73.  
  74. if ( !(hwndViewFrame = CreateStdWindow(HWND_DESKTOP, WS_VISIBLE,
  75.                        FCF_NOBYTEALIGN | FCF_TASKLIST |    
  76.                        FCF_TITLEBAR | FCF_ICON | FCF_SYSMENU |
  77.                        FCF_MENU    | FCF_MINMAX | FCF_SIZEBORDER,
  78.                        pszViewClassName, (PSZ)"Icon/Pointer Viewer", 0L,
  79.                        (HMODULE)NULL, WIN_VIEWER, &hwndView, 10, 31, 226, 101))    )
  80.    return(0);
  81.  
  82. InitApp(hwndViewFrame, hwndView, NULL);
  83.  
  84.                /* Get and dispatch the message to program    */
  85.                /* windows                    */
  86.  
  87. while (    WinGetMsg(hAB, &qmsg, (HWND)NULL, 0UL, 0UL) )
  88.    WinDispatchMsg(hAB, &qmsg);
  89.  
  90.                /* Have received    a WM_QUIT, start the program    */
  91.                /* shutdown by destroying the program windows    */
  92.                /* and destroying the message queue        */
  93.  
  94. WinDestroyWindow(hwndViewFrame);
  95.  
  96. WinDestroyMsgQueue(hmqView);
  97.  
  98.                /* Notify PM that main program thread not needed    */
  99.                /* any longer                    */
  100. WinTerminate(hAB);
  101.                /* Exit back to OS/2 cleanly            */
  102. return(0);
  103. }
  104.