Making the mouse cursor wrap around the desktop

  • Thread starter Thread starter jwgoerlich
  • Start date Start date
J

jwgoerlich

My goal is to create an app that measures the distance my mouse has
moved, and wraps the mouse around should it reach the edge of the
screen. I have been able to track the mouse around the desktop using
SetWindowsHookEx (thanks Claes Bergefall!). Now what I want to do is
to move the mouse cursor. For instance:

If Cursor.Position.X < 10 Then
Cursor.Position = New Point( _
Screen.PrimaryScreen.Bounds.Width, _
Cursor.Position.X)
End If

The problem is that the Cursor.Position does not seem to work if
called while the mouse is moving.

Any help appreciated,

J Wolfgang Goerlich
 
Back
Top