HOWTO: Define, Display Graphics Mouse Cursor in FORTRAN 5.00

ID: Q51225


The information in this article applies to:
  • Microsoft Mouse driver for MS-DOS, versions 6.x, 7.x, 8.x


SUMMARY

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


\* codeon

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

\* codeoff 

Additional query words: program fortran

Keywords : kbdisplay kbgraphic kbhw
Version : MS-DOS:6.x,7.x,8.x
Platform : MS-DOS
Issue type : kbhowto


Last Reviewed: December 15, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.