HOWTO: Define, Display Graphics Mouse Cursor in FORTRAN 5.00

Last reviewed: March 12, 1997
Article ID: Q51225
6.x 7.x 8.x MS-DOS kbhw kbdisplay kbgraphics kbcode

The information in this article applies to:

  • Microsoft Mouse Driver for MS-DOS, versions 6.x, 7.x, and 8.x

The following code shows how to define and display a graphics mouse cursor in Microsoft FORTRAN version 5.00:

c This program displays mouse cursor in a shape of a cross. c The program terminates when the user presses the ENTER c key.

      include 'fgraph.fi'
      include 'fgraph.fd'
      integer*2 m1,m2,m3,m4
      integer*2 mcursor(32)
      integer*2 arrloc(2)
      integer*4 arradds
      equivalence (arrloc(1),arradds)

      do 50 i=1,16                   !define the screen mask
 50      mcursor(i) = #ffff
         mcursor(17) = #0000         !define the cursor mask
         mcursor(18) = #0180
         mcursor(19) = #0180
         mcursor(20) = #0180
         mcursor(21) = #7ffe
         mcursor(22) = #0180
         mcursor(23) = #0180
         mcursor(24) = #0180
         mcursor(25) = #0000
         mcursor(26) = #0000
         mcursor(27) = #0000
         mcursor(28) = #0000
         mcursor(29) = #0000
         mcursor(30) = #0000
         mcursor(31) = #0000
         mcursor(32) = #0000

      m1 = 0
      call mousel(m1,m2,m3,m4)         !reset mouse driver
      dummy = setvideomode($erescolor) !set video mode (EGA)
      m1 = 9
      m2 = 1
      m3 = 1
      arradds = locfar(mcursor) !get address of cursor array
      call mousel(m1,m2,m3,arrloc(1))  !set graphics cursor
      m1 = 1
      call mousel(m1,m2,m3,m4)         !show cursor
      read(*,*)                        !press enter to quit
      m1 = 2
      call  mousel(m1,m2,m3,m4)        !hide cursor
      dummy = setvideomode($defaultmode) !set video mode
      end


KBCategory: kbhw kbdisplay kbgraphics kbcode
KBSubcategory:
Additional reference words: program fortran
Keywords : kbdisplay kbgraphic kbhw
Version : 6.x 7.x 8.x
Platform : MS-DOS
Issue type : kbhowto
Resolution Type : kbcode


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: March 12, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.