home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / OS2BAS.ZIP / WELCO.BAS < prev    next >
BASIC Source File  |  1989-09-11  |  2KB  |  41 lines

  1. '--------------------------------------------
  2. ' WELCO.BAS -- A Program with a Message Loop
  3. '--------------------------------------------
  4. REM $INCLUDE: 'PMBase.BI'
  5.  
  6. DIM aqmsg AS QMSG
  7.  
  8. flFrameFlags& = FCFTITLEBAR     OR FCFSYSMENU OR _
  9.         FCFSIZEBORDER     OR FCFMINMAX  OR _
  10.         FCFSHELLPOSITION OR FCFTASKLIST
  11.  
  12. hab& = WinInitialize(0)
  13. hmq& = WinCreateMsgQueue(hab&, 0)
  14.  
  15. hwndFrame& = WinCreateStdWindow (_
  16.              HWNDDESKTOP,_                     ' Parent window handle
  17.              WSVISIBLE,_                       ' Style of frame window
  18.              MakeLong (VARSEG(flFrameFlags&),_ ' Pointer to control data
  19.                        VARPTR(flFrameFlags&)),_
  20.              0,_                               ' Client window class name
  21.              0,_                               ' Title bar text
  22.              0,_                               ' Style of client window
  23.              0,_                               ' Module handle for resources
  24.              0,_                               ' ID of resources
  25.              0)                                ' Pointer to client window handle
  26.  
  27. WHILE (WinGetMsg(hab&, MakeLong(VARSEG(aqmsg), VARPTR(aqmsg)), 0, 0, 0))
  28.   bool% = WinDispatchMsg(hab&, MakeLong(VARSEG(aqmsg), VARPTR(aqmsg)))
  29. WEND
  30.  
  31. bool% = WinDestroyWindow(hwndFrame&)
  32. bool% = WinDestroyMsgQueue(hmq&)
  33. bool% = WinTerminate(hab&)
  34.  
  35. END
  36.  
  37.  
  38. '*** ClientWndProc needed to eliminate unresolved externals from REGBAS.LIB
  39. FUNCTION ClientWndProc&(hwnd&, msg%, mp1&, mp2&)
  40. END FUNCTION
  41.