|
-
Aug 14th, 2000, 11:18 AM
#1
Thread Starter
Fanatic Member
How do i make the mouse invisible for my program? I runs at full screen.
GWDASH
[b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]
-
Aug 14th, 2000, 11:31 AM
#2
-
Aug 17th, 2000, 12:31 PM
#3
Fanatic Member
You can use the ShowCursor() API, but a more simple solution is to create a cursor "NOTHING.CUR" with nothing in it. Apply it in the Windows Configuration Screen\Mouse and your mousie will be no longer visible!
-
Aug 17th, 2000, 06:27 PM
#4
Originally posted by Mad Compie
You can use the ShowCursor() API, but a more simple solution is to create a cursor "NOTHING.CUR" with nothing in it. Apply it in the Windows Configuration Screen\Mouse and your mousie will be no longer visible!
I don't have that cursor, but why would you want to make it totally invisible? That'll screw you up a lot because you won't know where the mouse pointer is. The best time to use the ShowCursor() Api should only be used for a screen saver, or your form only. Anything else and that would definitly irriatate or piss (can I say that?) someone off.
-
Aug 18th, 2000, 12:52 PM
#5
transcendental analytic
Well, ClipCursor does the trick
Code:
'In a module
Declare Function ShowCursor Lib "user32" (ByVal bShow As Long) As Long
Declare Function ClipCursor Lib "user32" (lpRect As Any) As Long
Property Let MouseVisible(newval As Boolean)
Dim TRect1 As RECT
Select Case newval
Case False 'To disable the mouse
With TRect1
.Left = 0: .Top = 0: .Right = 1: .Bottom = 1
End With
ClipCursor TRect1
ShowCursor False
Case True 'To enable the mouse
ClipCursor 0
ShowCursor True
End Select
End Property
'in code
'To disable
MouseVisible = False
'to get mouse back
MouseVisible = True
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Aug 18th, 2000, 01:18 PM
#6
All you need is this:
Code:
'Make it visible
ShowCursor 1
'Make it invisible
ShowCursor 0
-
Aug 18th, 2000, 02:13 PM
#7
Fanatic Member
The ShowCursor() API is only usefull in a certain application. If Windows enters the Standby-Suspend modus, the cursors appears again!
The NULL.CUR cursor is indeed interesting if you are using an embedded PC, with a touch panel (like in a kiosk, the user don't really want to see the cursor...)
-
Aug 18th, 2000, 08:31 PM
#8
transcendental analytic
The thing with Clipcursor is, that you don't click around on stuff when you don't see the cursor. So by setting the rect to the topleft corner you can't click on anything hazardous
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Aug 21st, 2000, 08:13 AM
#9
When you call ShowCursor you are actually incrementing (if you pass True) or decrementing (if you pass False) the internal display counter by one.
So if you call ShowCursor(False) twice you have to call ShowCursor(True) twice to show the cursor again.
So you should always check the return value of ShowCursor. If the return value is less then zero the mouse pointer is hidden and if the return value is zero or above the cursor is visible.
The internal display counter is set to zero at system startup if a mouse is present, otherwise it's set to -1.
-
Aug 21st, 2000, 01:42 PM
#10
transcendental analytic
Good point Joacim, so here's how it should look like
Code:
Declare Function ShowCursor Lib "user32" (ByVal bShow As Long) As Long
Property Get CursorVisible() As Boolean
CursorVisible = -ShowCursor(True)
ShowCursor (False)
End Property
Property Let CursorVisible(Newvalue As Boolean)
Do While ShowCursor(Newvalue) * Sgn(Newvalue + 0.5) > 0
Loop
End Property
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
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
|