|
-
Jun 23rd, 2001, 10:35 PM
#1
ShowCursor and IDE
I'm using simple ShowCursor to show/hide the mouse in my game:
VB Code:
'hide
Do While ShowCursor(0) >= 0
DoEvents
Loop
'show
Do While ShowCursor(1) < 0
DoEvents
Loop
But theres a problem showing the cursor again. When I get back to the VB IDE the mouse isn't visible, but everywhere else (anywhere outside the VB IDE) it is visible.
-
Jun 24th, 2001, 11:56 AM
#2
It sounds like the code you use to Show the cursor again isn't getting called, this could be because you use the IDE Stop functionality to stop your app instead of closing the Form, or you call End somewhere in your form instead of Unload Me.
-
Jun 25th, 2001, 03:42 AM
#3
Thanks for the idea...but that wasn't it. The program is DirectX based running at full screen, and the order I unload in is
1. show cursor
2. unload directx
3. end
And I'm pretty sure it's executing, as I once commented out the showing code and the cursor didn't show at all.
-
Jun 25th, 2001, 01:56 PM
#4
this works for me...
Private Sub MouseCursor(Mstate As Boolean)
Dim ret As Long
If Mstate = False Then
'turn off
Do
ret = ShowCursor(False)
Loop Until ret < 0
Else
'turn on
Do
ret = ShowCursor(True)
Loop Until ret > -1
End If
'update
CursorState = Mstate
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|