home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PROGRAMS / UTILS / MOUSE / MSMOUSE1.ZIP / BAS.ZIP / MOUSEDEM.BAS < prev    next >
Encoding:
BASIC Source File  |  1989-01-24  |  19.0 KB  |  643 lines

  1. '*******************************************************************
  2. '*  MOUSEDEM.BAS                                                   *
  3. '*  By Kyle Sparks, Microsoft Corporation, 1988                    *
  4. '*                                                                 *
  5. '*  Demonstrates calling mouse functions using a subprogram        *
  6. '*  named MouseDriver.  This subprogram uses CALL INTERRUPT        *
  7. '*  to access the mouse driver.                                    *
  8. '*                                                                 *
  9. '*  To load QB.QLB into memory with QuickBASIC, type: QB /L QB.QLB *
  10. '*******************************************************************
  11.  
  12. DEFINT A-Z
  13.  
  14. '------------------------------ Define Types --------------------------------
  15.  
  16. TYPE Register              'for CALL INTERRUPT
  17.      ax    AS INTEGER
  18.      bx    AS INTEGER
  19.      cx    AS INTEGER
  20.      dx    AS INTEGER
  21.      bp    AS INTEGER
  22.      si    AS INTEGER
  23.      di    AS INTEGER
  24.      flags AS INTEGER
  25. END TYPE
  26.  
  27. '--------------------- Declare Procedures and Functions ---------------------
  28.  
  29. DECLARE FUNCTION MouseDoubleClick (Delay%, Button%, m3%, m4%)
  30.  
  31. ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  32.  
  33. DECLARE SUB Interrupt (intnum AS INTEGER, inreg AS Register, outreg AS Register)
  34. DECLARE SUB MakeBox (Left%, Top%, Right%, Bottom%, Border%)
  35. DECLARE SUB MouseDriver (m0%, m1%, m2%, m3%)
  36. DECLARE SUB MouseConfineCursor (Left%, Top%, Right%, Bottom%)
  37. DECLARE SUB MouseDefinePerimeter ()
  38. DECLARE SUB MouseInit ()
  39. DECLARE SUB MouseOn ()
  40. DECLARE SUB MouseOff ()
  41. DECLARE SUB MouseSetHardCursor ()
  42. DECLARE SUB MouseSetSoftCursor ()
  43. DECLARE SUB MouseShowCoord ()
  44. DECLARE SUB MoveToScreen (x1%, y1%, x2%, y2%, Buffer())
  45. DECLARE SUB MoveFromScreen (x1%, y1%, x2%, y2%, Buffer())
  46. DECLARE SUB PopDown (OldY%)
  47. DECLARE SUB PopUp (OldY%)
  48.  
  49. '--------------------------- Main Control Program ---------------------------
  50.  
  51. 'BEGIN
  52.  
  53.    CLS
  54.    PRINT STRING$(80 * 25, 176);
  55.  
  56.    PopUp OldY
  57.    MouseInit
  58.    MouseShowCoord
  59.    MouseSetHardCursor
  60.    MouseSetSoftCursor
  61.    MouseDefinePerimeter
  62.    PopDown OldY
  63.  
  64. END
  65.  
  66. SUB MakeBox (Left, Top, Right, Bottom, Border)
  67. '----------------------------------------------------------------------------
  68. '  Procedure MakeBox draws a box on the screen starting at Top, Left and
  69. '  ending at Bottom, Right using either no border, or a single or double-
  70. '  line border based on the value of Border.
  71. '----------------------------------------------------------------------------
  72.  
  73.    SELECT CASE Border
  74.       CASE 1
  75.           VertLine$ = CHR$(179)
  76.          HorizLine$ = CHR$(196)
  77.             UpLeft$ = CHR$(218)
  78.            UpRight$ = CHR$(191)
  79.            LowLeft$ = CHR$(192)
  80.           LowRight$ = CHR$(217)
  81.  
  82.       CASE 2
  83.           VertLine$ = CHR$(186)
  84.          HorizLine$ = CHR$(205)
  85.             UpLeft$ = CHR$(201)
  86.            UpRight$ = CHR$(187)
  87.            LowLeft$ = CHR$(200)
  88.           LowRight$ = CHR$(188)
  89.  
  90.       CASE ELSE
  91.           VertLine$ = CHR$(32)
  92.          HorizLine$ = CHR$(32)
  93.             UpLeft$ = CHR$(32)
  94.            UpRight$ = CHR$(32)
  95.            LowLeft$ = CHR$(32)
  96.           LowRight$ = CHR$(32)
  97.  
  98.    END SELECT
  99.  
  100.    LOCATE Top, Left
  101.    PRINT UpLeft$; STRING$((Right - Left) - 1, HorizLine$); UpRight$;
  102.    FOR Y = Top + 1 TO Bottom - 1
  103.       LOCATE Y, Left
  104.       PRINT VertLine$; SPACE$((Right - Left) - 1); VertLine$;
  105.    NEXT Y
  106.    LOCATE Bottom, Left
  107.    PRINT LowLeft$; STRING$((Right - Left) - 1, HorizLine$); LowRight$;
  108.  
  109. END SUB
  110.  
  111. SUB MouseConfineCursor (Left, Top, Right, Bottom)
  112. '----------------------------------------------------------------------------
  113. '  Procedure MouseConfineCursor makes mouse function calls to confine the
  114. '  mouse cursor to the specified area.
  115. '----------------------------------------------------------------------------
  116.  
  117.    Border = 1
  118.  
  119.    m1 = 7                'Mouse Function 7, Set Minimum and Maximum
  120.                          'Horizontal Cursor Position
  121.    m3 = (Left - 1) * 8   'Minimum
  122.    m4 = (Right - 1) * 8  'Maximum
  123.    MouseDriver m1, m2, m3, m4
  124.  
  125.    m1 = 8                'Mouse Function 8, Set Minimum and Maximum
  126.                          'Vertical Cursor Position
  127.    m3 = (Top - 1) * 8    'Minimum
  128.    m4 = (Bottom - 1) * 8 'Maximum
  129.    MouseDriver m1, m2, m3, m4
  130.  
  131. END SUB
  132.  
  133. SUB MouseDefinePerimeter
  134. '----------------------------------------------------------------------------
  135. '  Procedure MouseDefinePerimeter defines the maximum and mininum vertical
  136. '  and horizontal boundaries for the mouse cursor, and then passes them
  137. '  to MouseConfineCursor.
  138. '----------------------------------------------------------------------------
  139.  
  140.    DIM Buffer(4000), Buffer2(4000)
  141.  
  142.    MoveFromScreen 17, 6, 60, 16, Buffer()
  143.  
  144.    COLOR 7, 0                   'FOREGROUND = white, BACKGROUND = black
  145.  
  146.    ulc = 17
  147.    ulr = 6
  148.    llc = 60
  149.    llr = 16
  150.    Border = 2
  151.  
  152.    MakeBox ulc, ulr, llc, llr, Border
  153.  
  154.    LOCATE ulr + 2, ulc + 3: PRINT "Select boundaries for mouse cursor."
  155.    LOCATE 23, 1
  156.  
  157.    LOCATE ulr + 4, ulc + 3
  158.    PRINT "Select the upper-left corner with";
  159.    LOCATE ulr + 5, ulc + 3
  160.    PRINT "mouse, and then press the button."
  161.  
  162.    MouseOn
  163.  
  164.    m1 = 3
  165.    m2 = 0
  166.  
  167.    WHILE m2 = 0
  168.       MouseDriver m1, m2, m3, m4
  169.    WEND
  170.    WHILE m2 > 0
  171.       MouseDriver m1, m2, m3, m4
  172.    WEND
  173.  
  174.    MouseOff
  175.  
  176.    Top = m4 \ 8
  177.    Left = m3 \ 8
  178.  
  179.    LOCATE ulr + 4, ulc + 3
  180.    PRINT "Select the lower-right corner with";
  181.    LOCATE ulr + 5, ulc + 3
  182.    PRINT "mouse, and then press the button."
  183.  
  184.    MouseOn
  185.  
  186.    m1 = 3
  187.    m2 = 0
  188.  
  189.    WHILE m2 = 0
  190.       MouseDriver m1, m2, m3, m4
  191.    WEND
  192.    WHILE m2 > 0
  193.       MouseDriver m1, m2, m3, m4
  194.    WEND
  195.  
  196.    MouseOff
  197.  
  198.    Bottom = m4 \ 8
  199.    Right = m3 \ 8
  200.    Border = 1
  201.  
  202.    MoveToScreen 17, 6, 60, 16, Buffer()
  203.    MoveFromScreen Left + 1, Top + 1, Right + 1, Bottom + 1, Buffer()
  204.    MakeBox Left + 1, Top + 1, Right + 1, Bottom + 1, Border
  205.    MouseConfineCursor Left + 1, Top + 1, Right + 1, Bottom + 1
  206.  
  207.    MoveFromScreen 1, 1, 80, 1, Buffer2()
  208.  
  209.    COLOR 0, 7
  210.    LOCATE 1, 1
  211.    PRINT SPACE$(19); "/>  Press left button twice to exit...  <."; SPACE$(19);
  212.    COLOR 7, 0
  213.    MouseOn
  214.  
  215.    Button = 0          'Check left button
  216.    WaitForClick = 1    'Wait 1 second for double-click
  217.  
  218.    WHILE X = 0
  219.       X = MouseDoubleClick(WaitForClick, Button, ClickX, ClickY)
  220.    WEND
  221.  
  222.    MouseOff
  223.  
  224.    MoveToScreen 1, 1, 80, 1, Buffer2()
  225.    MoveToScreen Left + 1, Top + 1, Right + 1, Bottom + 1, Buffer()
  226.  
  227. END SUB
  228.  
  229. FUNCTION MouseDoubleClick (Delay, Button, m3, m4)
  230. '----------------------------------------------------------------------------
  231. '  Function MouseDoubleClick returns a zero if the mouse button specified by
  232. '  Button has not been double-clicked within the time specified by Delay, or
  233. '  a one if it has.  Button is either 0 (Left) or 1 (Right).
  234. '
  235. '  RETURNS:
  236. '
  237. '     m1 = button status.  0 = No buttons pressed
  238. '                          1 = Left button pressed
  239. '                          2 = Right button pressed
  240. '                          3 = Both buttons pressed
  241. '
  242. '     m2 = Number of button presses on specified button
  243. '     m3 = Horizontal cursor position at last button press.
  244. '     m4 = Vertical cursor position at last button press.
  245. '
  246. '----------------------------------------------------------------------------
  247.  
  248.    m1 = 5      'Mouse Function 5, Get Button Press Information
  249.    m2 = Button 'Button to check
  250.    MouseDriver m1, m2, m3, m4
  251.  
  252.    WaitForClick& = TIMER + Delay
  253.    WHILE TIMER < WaitForClick&: WEND
  254.  
  255.    m1 = 5      'Mouse Function 5, Get Button Press Information
  256.    m2 = Button
  257.    MouseDriver m1, m2, m3, m4
  258.  
  259.    IF m2 > 1 THEN MouseDoubleClick = 1 ELSE MouseDoubleClick = 0
  260.  
  261. END FUNCTION
  262.  
  263. SUB MouseDriver (m0, m1, m2, m3) STATIC
  264. '----------------------------------------------------------------------------
  265. '  Procedure MouseDriver uses Interrupt 51 to invoke mouse functions in the
  266. '  Microsoft mouse driver.  NOTE:  ALL parameters to this procedure MUST
  267. '  be of type INTEGER.
  268. '----------------------------------------------------------------------------
  269.  
  270.    DIM regs AS Register
  271.  
  272.    regs.ax = m0
  273.    regs.bx = m1
  274.    regs.cx = m2
  275.    regs.dx = m3
  276.  
  277.    Interrupt 51, regs, regs
  278.  
  279.    m0 = regs.ax
  280.    m1 = regs.bx
  281.    m2 = regs.cx
  282.    m3 = regs.dx
  283.  
  284. END SUB
  285.  
  286. SUB MouseInit
  287. '----------------------------------------------------------------------------
  288. '  Procedure MouseInit initializes the mouse and detects whether
  289. '  the Microsoft mouse driver is installed.
  290. '----------------------------------------------------------------------------
  291.  
  292.    DIM Buffer(4000)
  293.  
  294.    MoveFromScreen 17, 6, 60, 13, Buffer()
  295.  
  296.    COLOR 7, 0                   'FOREGROUND = white, BACKGROUND = black
  297.  
  298.    ulc = 17
  299.    ulr = 6
  300.    llc = 60
  301.    llr = 13
  302.    Border = 2
  303.  
  304.    MakeBox ulc, ulr, llc, llr, Border
  305.  
  306.    m1 = 0
  307.    MouseDriver m1, m2, m3, m4
  308.  
  309.    IF NOT m1 THEN
  310.       LOCATE 8, 25
  311.       PRINT "Microsoft Mouse not installed."
  312.       MoveToScreen 17, 6, 60, 12, Buffer()
  313.       t = TIMER + 2
  314.       WHILE TIMER < t: WEND
  315.       END
  316.    ELSE
  317.       LOCATE 8, 25
  318.       PRINT "Microsoft Mouse found."
  319.       LOCATE 9, 25
  320.       PRINT "Buttons:"; m2
  321.    END IF
  322.  
  323.    WHILE INKEY$ <> CHR$(13): WEND
  324.  
  325.    MoveToScreen 17, 6, 60, 13, Buffer()
  326.  
  327. END SUB
  328.  
  329. SUB MouseOff
  330. '----------------------------------------------------------------------------
  331. '  Procedure MouseOff turns the mouse cursor off. (Mouse Function 2)
  332. '----------------------------------------------------------------------------
  333.  
  334.    m1 = 2
  335.    MouseDriver m1, m2, m3, m4
  336.  
  337. END SUB
  338.  
  339. SUB MouseOn
  340. '----------------------------------------------------------------------------
  341. '  Procedure MouseOn turns the mouse cursor on.  (Mouse Function 1)
  342. '----------------------------------------------------------------------------
  343.  
  344.    m1 = 1
  345.    MouseDriver m1, m2, m3, m4
  346.  
  347. END SUB
  348.  
  349. SUB MouseSetHardCursor
  350. '----------------------------------------------------------------------------
  351. '  Procedure MouseSetHardCursor selects the hardware text cursor to use
  352. '  for the mouse.
  353. '----------------------------------------------------------------------------
  354.  
  355.    DIM Buffer(4000)
  356.  
  357.    MoveFromScreen 17, 6, 60, 13, Buffer()
  358.  
  359.    COLOR 0, 7                   'FOREGROUND = black, BACKGROUND = white
  360.  
  361.    ulc = 17
  362.    ulr = 6
  363.    llc = 60
  364.    llr = 13
  365.    Border = 1
  366.  
  367.    MakeBox ulc, ulr, llc, llr, Border
  368.  
  369.    LOCATE ulr + 2, ulc + 1: PRINT "    This procedure uses the hardware    "
  370.    LOCATE ulr + 3, ulc + 1: PRINT "    text cursor as the mouse cursor,    "
  371.    LOCATE ulr + 4, ulc + 1: PRINT "    causing a blinking mouse cursor.    "
  372.    LOCATE ulr + 6, ulc + 1: PRINT "       <Press button to continue>       "
  373.  
  374.    m1 = 10                      'Mouse Function 10, Set Text Cursor
  375.    m2 = 1                       'Select hardware text cursor
  376.    m3 = 2                       'Top scan line of text cursor
  377.    m4 = 7                       'Bottom scan line of text cursor
  378.  
  379.    MouseDriver m1, m2, m3, m4
  380.  
  381.    MouseOn
  382.  
  383.    m1 = 3                       'Mouse Function 3, Get Button Status and
  384.                                 'Mouse Position
  385.    m2 = 0
  386.  
  387.    WHILE m2 = 0
  388.       MouseDriver m1, m2, m3, m4
  389.    WEND
  390.  
  391.    MoveToScreen 17, 6, 60, 13, Buffer()
  392.  
  393.    MouseOn
  394.  
  395.    LOCATE , , 1, 6, 7
  396.    LOCATE , , 0
  397.  
  398.    MouseOff
  399.  
  400. END SUB
  401.  
  402. SUB MouseSetSoftCursor
  403. '----------------------------------------------------------------------------
  404. '  Procedure MouseSetSoftCursor selects the hardware text cursor to use
  405. '  for the mouse.
  406. '
  407. '  m3 = screen mask
  408. '  m4 = cursor mask
  409. '
  410. '    ■  The screen mask determines which of the character's attributes
  411. '       are preserved.
  412. '
  413. '    *  The cursor mask determines how these attributes are changed to
  414. '       yield the cursor.
  415. '
  416. '  The bit values for the screen and cursor mask are:
  417. '
  418. '     BIT      PURPOSE
  419. '     -------  ----------------------
  420. '     15       1 = blinking, 0 = normal
  421. '     12-14    3 byte foreground color (000 = 0, 111 = 7)
  422. '     11       1 = high intensity, 0 = normal intensity
  423. '     08-10    3 byte background color (000 = 0, 111 = 7)
  424. '     00-07    8 byte ASCII value of character for cursor
  425. '              (00000000 = 0, 11111111 = 255 or CHR$(255))
  426. '
  427. '  The default values are indicated below.  They are the most useful values
  428. '  for this function.
  429. '----------------------------------------------------------------------------
  430.  
  431.    m1 = 10     'Mouse Function 10, Set Text Cursor
  432.    m2 = 0      'Select software mouse cursor
  433.  
  434.                '                            1           0
  435.                '                BIT   5432 1098 7654 3210
  436.                '                      ----|----|----|----
  437.    m3 = &HFFFF 'Screen mask: Binary = 1111 1111 1111 1111
  438.                '                Hex =  F    F    F    F
  439.                '            Decimal = 32767 (2^15 + 2^14 +...+ 2^1 + 2^0)
  440.  
  441.    m4 = &H7700 'Cursor mask: Binary = 0111 0111 0000 0000
  442.                '                Hex =  7    7    0    0
  443.                '            Decimal = 30464 (2^14 + 2^13 + 2^12 +2^10 + 2^9 + 2^8)
  444.  
  445.    MouseDriver m1, m2, m3, m4
  446.  
  447. END SUB
  448.  
  449. SUB MouseShowCoord
  450. '----------------------------------------------------------------------------
  451. '  Procedure MouseShowCoord shows the mouse coordinates and button status
  452. '  in a window on the screen.
  453. '----------------------------------------------------------------------------
  454.  
  455.    DIM Buffer(4000)
  456.  
  457.    MoveFromScreen 17, 6, 60, 13, Buffer()
  458.  
  459.    COLOR 7, 0                   'FOREGROUND = white, BACKGROUND = black
  460.  
  461.    ulc = 17
  462.    ulr = 6
  463.    llc = 60
  464.    llr = 13
  465.    Border = 2
  466.  
  467.    MakeBox ulc, ulr, llc, llr, Border
  468.  
  469.    LOCATE ulr + 6, ulc + 1: PRINT "       <Use Mouse or press Enter>        "
  470.  
  471.    LOCATE 7, 19
  472.    PRINT "Show Mouse Coordinates and Button Status"
  473.    LOCATE 9, 25
  474.    PRINT "Mouse X:       Button 1:"
  475.    LOCATE 10, 25
  476.    PRINT "Mouse Y:       Button 2:"
  477.  
  478.    MouseOn
  479.  
  480.    m1 = 3               'Mouse function 3, Get Button Status and Mouse Position
  481.  
  482.    WHILE X$ <> CHR$(13)
  483.       X$ = INKEY$
  484.       MouseDriver m1, m2, m3, m4
  485.       LOCATE 9, 33
  486.       PRINT m3 \ 8
  487.       LOCATE 10, 33
  488.       PRINT m4 \ 8
  489.       LOCATE 9, 50
  490.       IF (m2 AND 1) = 1 OR m2 = 3 THEN PRINT "Down" ELSE PRINT "Up  "
  491.       LOCATE 10, 50
  492.       IF (m2 AND 2) = 2 OR m2 = 3 THEN PRINT "Down" ELSE PRINT "Up  "
  493.    WEND
  494.  
  495.    MouseOff
  496.  
  497.    MoveToScreen 17, 6, 60, 13, Buffer()
  498.  
  499. END SUB
  500.  
  501. SUB MoveFromScreen (x1%, y1%, x2%, y2%, Buffer() AS INTEGER) STATIC
  502. '----------------------------------------------------------------------------
  503. '  Procedure MoveFromScreen will copy a section of screen RAM.
  504. '----------------------------------------------------------------------------
  505.  
  506.    DEF SEG = 0
  507.  
  508.    SELECT CASE PEEK(&H449)    'Figure out what video mode is being used
  509.       CASE 0 TO 3
  510.          display = &HB800     'CGA and EGA text modes
  511.       CASE 7
  512.          display = &HB000     'Monochrome text mode
  513.       CASE ELSE
  514.          CLS                  'Not a text mode, or not a compatible card
  515.          EXIT SUB
  516.    END SELECT
  517.  
  518.    DEF SEG = display   'Define the segment to be the display memory
  519.  
  520.    FOR XPeek = (x1% - 1) * 2 TO ((x2% - 1) * 2) + 1
  521.       FOR YPeek = y1% - 1 TO y2% - 1
  522.          Buffer((YPeek * 160) + XPeek) = PEEK((YPeek * 160) + XPeek)
  523.       NEXT YPeek
  524.    NEXT XPeek
  525.  
  526.    DEF SEG                      'Reset segment pointer
  527.  
  528. END SUB
  529.  
  530. SUB MoveToScreen (x1%, y1%, x2%, y2%, Buffer() AS INTEGER) STATIC
  531. '----------------------------------------------------------------------------
  532. '  Procedure MoveToScreen will replace the copied screen RAM.
  533. '----------------------------------------------------------------------------
  534.  
  535.    DEF SEG = 0
  536.  
  537.    SELECT CASE PEEK(&H449)    'Figure out what video mode is being used
  538.       CASE 0 TO 3
  539.          display = &HB800     'CGA and EGA text modes
  540.       CASE 7
  541.          display = &HB000     'Monochrome text mode
  542.       CASE ELSE
  543.          CLS                  'Not a text mode, or not a compatible card
  544.          EXIT SUB
  545.    END SELECT
  546.  
  547.    DEF SEG = display   'Define the segment to be the display memory
  548.  
  549.    FOR XPeek = (x1% - 1) * 2 TO ((x2% - 1) * 2) + 1
  550.       FOR YPeek = y1% - 1 TO y2% - 1
  551.          POKE ((YPeek * 160) + XPeek), Buffer((YPeek * 160) + XPeek)
  552.       NEXT YPeek
  553.    NEXT XPeek
  554.  
  555.    DEF SEG                      'Reset segment pointer
  556.  
  557. END SUB
  558.  
  559. SUB PopDown (OldY)
  560. '----------------------------------------------------------------------------
  561. '  Procedure PopDown wraps the program up with a final message, and then
  562. '  waits for a double-click in the 'Okay' box.
  563. '----------------------------------------------------------------------------
  564.  
  565.    DIM Buffer(4000)
  566.  
  567.    MoveFromScreen 17, 6, 60, 17, Buffer()
  568.    MouseConfineCursor 18, 7, 59, 16
  569.  
  570.    COLOR 0, 7                   'FOREGROUND = black, BACKGROUND = white
  571.  
  572.    ulc = 17
  573.    ulr = 6
  574.    llc = 60
  575.    llr = 17
  576.    Border = 2
  577.  
  578.    MakeBox ulc, ulr, llc, llr, Border
  579.  
  580.    LOCATE ulr + 2, ulc + 1:  PRINT " This is the end of this demonstration. "
  581.    LOCATE ulr + 3, ulc + 1:  PRINT " For more information on these and      "
  582.    LOCATE ulr + 4, ulc + 1:  PRINT " other mouse functions, please see The  "
  583.    LOCATE ulr + 5, ulc + 1:  PRINT " Microsoft Mouse Programmer's Reference."
  584.    LOCATE ulr + 6, ulc + 1:  PRINT "                                        "
  585.    LOCATE ulr + 7, ulc + 1:  PRINT "                                        "
  586.    LOCATE ulr + 8, ulc + 1:  PRINT "                       ┌────────────┐   "
  587.    LOCATE ulr + 9, ulc + 1:  PRINT " Double-click to end.  │    Okay    │   "
  588.    LOCATE ulr + 10, ulc + 1: PRINT "                       └────────────┘   "
  589.  
  590.    MouseOn
  591.  
  592.    Button = 0          'Check Left button
  593.    WaitForClick = 1    'Wait 1 second for double-click
  594.  
  595.    WHILE ButtonCheck = 0 OR ((X < 40 OR X > 53) OR (Y < 13 OR Y > 15))
  596.       ButtonCheck = MouseDoubleClick(WaitForClick, Button, ClickX, ClickY)
  597.       X = ClickX \ 8
  598.       Y = ClickY \ 8
  599.    WEND
  600.  
  601.    MouseOff
  602.  
  603.    MoveToScreen 17, 6, 60, 17, Buffer()
  604.  
  605.    LOCATE OldY, , 0
  606.    COLOR 7, 0
  607.  
  608. END SUB
  609.  
  610. SUB PopUp (OldY)
  611. '----------------------------------------------------------------------------
  612. '  Procedure Popup displays an introductory message on the screen.
  613. '----------------------------------------------------------------------------
  614.  
  615.    OldY = CSRLIN               'Memorize old Y text cursor positon
  616.  
  617.    DIM Buffer(4000)
  618.  
  619.    MoveFromScreen 17, 6, 60, 17, Buffer()
  620.  
  621.    COLOR 0, 7                    'FOREGROUND = black, BACKGROUND = white
  622.  
  623.    ulc = 17
  624.    ulr = 6
  625.    llc = 60
  626.    llr = 17
  627.    Border = 2
  628.  
  629.    MakeBox ulc, ulr, llc, llr, Border
  630.  
  631.    LOCATE ulr + 2, ulc + 1:  PRINT "    Calling the Microsoft Mouse from    "
  632.    LOCATE ulr + 3, ulc + 1:  PRINT "         QuickBASIC Version 4           "
  633.    LOCATE ulr + 5, ulc + 1:  PRINT "       Samples and Demonstration        "
  634.    LOCATE ulr + 6, ulc + 1:  PRINT "                Programs                "
  635.    LOCATE ulr + 8, ulc + 1:  PRINT " By Kyle Sparks, Microsoft Corp., 1988  "
  636.    LOCATE ulr + 10, ulc + 1: PRINT "              <press Enter>             "
  637.    WHILE INKEY$ <> CHR$(13): WEND
  638.    LOCATE 23, 1
  639.  
  640.    MoveToScreen 17, 6, 60, 17, Buffer()
  641.  
  642. END SUB
  643.