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

  1. '-------------------------------------------------------
  2. ' WELCOME.BAS -- A Program that Creates a Client Window
  3. '-------------------------------------------------------
  4. REM $INCLUDE: 'PMBase.BI'
  5. REM $INCLUDE: 'WinFrame.BI'
  6. REM $INCLUDE: 'WinPoint.BI'
  7.  
  8. DIM aqmsg AS QMSG
  9.  
  10. szClientClass$ = "Welcome" + CHR$(0)
  11.  
  12. flFrameFlags& = FCFTITLEBAR     OR FCFSYSMENU OR _
  13.         FCFSIZEBORDER     OR FCFMINMAX  OR _
  14.         FCFSHELLPOSITION OR FCFTASKLIST
  15.  
  16. hab& = WinInitialize(0)
  17. hmq& = WinCreateMsgQueue(hab&, 0)
  18.  
  19. bool% = WinRegisterClass(_
  20.              hab&,_                             ' Anchor block handle
  21.              MakeLong(VARSEG(szClientClass$),_  ' Name of class being registered
  22.                         SADD(szClientClass$)),_
  23.              RegBas,_                           ' Window procedure for class
  24.              0,_                                ' Class style
  25.              0)                                 ' Extra bytes to reserve
  26.  
  27. hwndFrame& = WinCreateStdWindow (_
  28.              HWNDDESKTOP,_                      ' Parent window handle
  29.              WSVISIBLE,_                        ' Style of frame window
  30.              MakeLong (VARSEG(flFrameFlags&),_  ' Pointer to control data
  31.                        VARPTR(flFrameFlags&)),_
  32.              MakeLong (VARSEG(szClientClass$),_ ' Client window class name
  33.                          SADD(szClientClass$)),_
  34.              0,_                                ' Title bar text
  35.              0,_                                ' Style of client window
  36.              0,_                                ' Module handle for resources
  37.              0,_                                ' ID of resources
  38.              MakeLong (VARSEG(hwndClient&),_    ' Pointer to client window handle
  39.                        VARPTR(hwndClient&)))
  40.  
  41. bool% = WinSendMsg(hwndFrame&, WMSETICON,_
  42.             WinQuerySysPointer(HWNDDESKTOP, SPTRAPPICON, FALSE),_
  43.             0)
  44.  
  45. WHILE (WinGetMsg(hab&, MakeLong(VARSEG(aqmsg), VARPTR(aqmsg)), 0, 0, 0))
  46.   bool% = WinDispatchMsg(hab&, MakeLong(VARSEG(aqmsg), VARPTR(aqmsg)))
  47. WEND
  48.  
  49. bool% = WinDestroyWindow(hwndFrame&)
  50. bool% = WinDestroyMsgQueue(hmq&)
  51. bool% = WinTerminate(hab&)
  52.  
  53. END
  54.  
  55. FUNCTION ClientWndProc&(hwnd&, msg%, mp1&, mp2&)
  56.      ClientWndProc& = WinDefWindowProc(hwnd&, msg%, mp1&, mp2&)
  57. END FUNCTION
  58.