vbdpss.hlp (Table of Contents; Topic list)
Article Q30856
                                                 Contents  Index  Back
─────────────────────────────────────────────────────────────────────────────
                           Knowledge Base Contents  Knowledge Base Index
 
 How to Make MOUSE CALLs in Hercules Graphics Mode, SCREEN 3 - Q30856
 
 You can design BASIC programs that make CALLs to the Microsoft Mouse
 driver on Hercules Monochrome SCREEN 3 in MS-DOS, but you must follow
 the steps below. (MOUSE CALLs let you change the mouse cursor, detect
 the mouse position, detect mouse-button status, etc.)
 
 Appendix D of the "Microsoft Mouse Programmer's Reference Guide"
 mentions three steps, but they are shown in the wrong order to work
 with Visual Basic, and QuickBasic. The steps shown on Page D-1 should
 be performed in the following order for Visual Basic and QuickBasic:
 
    2, 3, 1
 
 The order 1, 2, 3 should be used for other languages.
 
 More Information:
 
 The information in this article applies to:
 
 - The Standard and Professional Editions of Microsoft Visual Basic
   version 1.0 for MS-DOS
 - Microsoft QuickBasic versions 4.0, 4.0b, and 4.5 for MS-DOS
 - Microsoft Basic Compiler Versions 6.0 and 6.0b under MS-DOS
 
 When making CALLs to the Microsoft Mouse driver on a computer with a
 Hercules Monochrome Graphics Adapter, do the following:
 
 1. In the AUTOEXEC.BAT file, invoke the Microsoft MOUSE.COM driver
    before the QBHERC.COM or MSHERC.COM Hercules Graphics driver. If
    QBHERC or MSHERC is mistakenly loaded first, the Hercules graphics
    cursor appears as several small horizontal (broken) lines in the
    graphics screen (or it does not appear at all), and the graphics
    drawing boundaries are confined to 640 x 200 pixels. (Normal SCREEN
    3 resolution is 720 x 348.)
 
    MSHERC.COM is shipped with QuickBasic version 4.5. QBHERC.COM is
    shipped with Microsoft QuickBasic versions 4.0 and 4.0b and with
    Microsoft Basic Compiler versions 6.0 and 6.0b.
 
 2. Perform one of the following steps, but not both:
 
    a. Start QB.EXE by typing QB /L MOUSE to load the Quick Library
       MOUSE.QLB into memory.
 
       You can use LINK /Q to make MOUSE.QLB from the MOUSE.LIB that
       comes on a disk along with the "Microsoft Mouse Programmer's
       Reference Guide." This guide can be ordered by returning the
       card in the Microsoft Mouse package.
 
    -- or --
 
    b. Start QB.EXE by typing QB /L QB.QLB and use the CALL INTERRUPT
       or CALL INT86OLD statements to access the mouse driver.
 
 3. To tell the mouse driver that you are in CRT Page 0, define the
    segment address (DEF SEG) at 40h and POKE a 6 into offset 49h.
    You must store 5 into memory offset 49h to use CRT Page 1.
    For example:
 
       DEF SEG = &H40
       POKE &H49, 6          ' CRT page 0.
       DEF SEG
 
 4. Call the mouse function 0 to initialize, as follows:
 
       CALL mouse(0,0,0,0)     ' Initialize mouse.
 
 5. Put the card into the graphics mode (i.e., change to SCREEN mode
    3), as follows:
 
       SCREEN 3, , 0, 0
 
 6. CALL the mouse to turn the mouse cursor on, as follows:
 
       CALL mouse(1, 0, 0, 0)     ' Turn mouse cursor on.
 
 QuickBasic versions 3.0 and earlier do not support Hercules
 Monochrome Graphics SCREEN 3.
 
 The techniques explained in this article do not work under the DOS box
 (real mode) of MS OS/2 (nor do they work in protected mode, which
 requires OS/2 MOU... API function calls from Microsoft Basic Compiler
 versions 6.0 or 6.0b to program the mouse). OS/2 normally loads its
 own mouse driver for the DOS box, and even if this driver is not
 loaded, OS/2 still reserves interrupt 33 for itself. If you install
 MOUSE.COM in the DOS box, OS/2 will tell you that the interrupt is
 owned by the system, and although a program can display the mouse
 cursor on Hercules SCREEN 3 (such as the Code Example below), the
 pointer will not move. You cannot program the mouse in Hercules
 graphics SCREEN 3 in the DOS box (real mode) of MS OS/2. However,
 you can program the mouse in other graphics screen modes in the DOS
 box of OS/2.
 
 Code Example
 ------------
 
 ' To try this example in VBDOS.EXE:
 ' 1. From the File menu, choose New Project.
 ' 2. Copy the code example to the Code window.
 ' 3. Press F5 to run the program.
 
 DEFINT A-Z
 DEF SEG = &H40
 POKE &H49, 6               ' CRT page 0.
 DEF SEG
 CALL mouse(0, 0, 0, 0)     ' Initialize mouse.
 SCREEN 3, , 0, 0           ' Switch to Hercules Graphics mode, page 0.
 
 m1 = 1
 CALL mouse(m1, m2, m3, m4)   ' Turn on mouse cursor (m1 = 1).
 WHILE INKEY$="":WEND
 CALL mouse(2, 0, 0, 0)       ' Turn off mouse cursor.
 END