Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Sunshow Pro V3.0 - <b>closelivemouse()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
CloseLiveMouse()

Close the live mouse


Syntax

CloseLiveMouse()


Returns

0
Success.

-99
Parameter is invalid.


Remarks

CloseLiveMouse() closes the live graphic mode mouse and removes the live 
mouse interrupt handler. Failure to remove this interrupt handler before 
program exit will cause a system crash. The live mouse interrupt handler 
is a special case that requires strict adherence to these rules in order 
to have the special features of a graphic mode SVGA mouse. You must call 
CloseLiveMouse() after accessing graphic mode mouse functions.


Example

nStatus = CheckMouse()
IF nStatus > 0
    nStatus = FindVideoMode(640,480,16)
    nStatus = OpenLiveMouse(320,240)
    nButtons =  0  
    nMouseX = 0
    nMouseY = 0
    nOldMouseX = 0
    nOldMouseY = 0

*   loop until a mouse button is pressed  

    DO WHILE nButtons = 0
        nButtons = GetMousePosition(@nMouseX, @nMouseY)

*       print mouse coordinates at 0,0 on screen

        nMouseX = int(nMouseX)
        nMouseY = int(nMouseY)
        IF nMouseX<>nOldMouseX .or. nMouseY<>nOldMouseY
            nStatus = HideMouse()
            nStatus = SunSay(0, 0, 16, 15, 0, "", ;
                "Mouse Coords:")
            nStatus = SunSay(0, 20, 16, 15, 0, "###", ;
                str(nMouseX))
            nStatus = SunSay(0, 23, 16, 15, 0, "", ", ")
            nStatus = SunSay(0, 25, 16, 15, 0, "###", ;
                str(nMouseY))
            nStatus = ShowMouse()
            nOldMouseX = nMouseX
            nOldMouseY = nMouseY
        ENDIF
    ENDDO
    nStatus = CloseLiveMouse()
    TextMode()
ELSE
    ? "No mouse driver detected"
ENDIF 

For other examples of how to use the mouse support functions, see 
SUNMOUSE.PRG, an example program distributed with Sunshow Pro.



See Also: CheckMouse() GetMousePosition() HideMouse() LimitMouse() OpenLiveMouse() PositionMouse() SetMouseCursor() ShowMouse()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson