Looping Constantly

  • Thread starter Thread starter DS
  • Start date Start date
D

DS

I have this code doing a constat loop. My question is:
Will this affect any other loops that might start? Will it disrupt any
timers or slow my system down? Anything I have to watch out for? This is
in a multi-user / multi- machine system.

Public Declare Function ShowCursor Lib "user32" _
(ByVal bShow As Long) As Long

Public Sub ShowPointer()
Do While ShowCursor(1) < 0
DoEvents
Loop
End Sub

Public Sub HidePointer()
Do While ShowCursor(0) >= -1
DoEvents
Loop
End Sub

Thanks
DS
 
I'm no expert, but the main thing I think you have to watch out for is that
you have a way of getting out of the loop or your application is going to go
off to La-La Land.

Just out of curiosity, why are you doing this, anyway?

Regards, Chris
 
I'm doing this to hide the mouse pointer. When the App starts it opens a
hidden form and hides the mouse, looping I guess to keep the mouse hidden.
Then when you exit the App the mouse reappears. I'm just worried bout it
getting in the way of other loops that might have to run or whatever else
has to happen. So any insight nto this matter on what could possibly
blow-up, I'm all ears.
Thanks
DS
 
Back
Top