well i can control the position of the mouse while the form has focus. But that is now what i want. i want to be able to control the mouse while the form is minimized or hidden or in the system tray. this is my working move mouse code maybe it could be optimized but i think it is good.
thank you for any help you may offer.Code:Public Class Form1 Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown Dim pos As Point Select Case e.KeyCode Case Keys.Left GetCursorPos(pos) SetCursorPos(pos.X - 1, pos.Y) Case Keys.Right GetCursorPos(pos) SetCursorPos(pos.X + 1, pos.Y) Case Keys.Up GetCursorPos(pos) SetCursorPos(pos.X, pos.Y - 1) Case Keys.Down GetCursorPos(pos) SetCursorPos(pos.X, pos.Y + 1) End Select End Sub Declare Function SetCursorPos Lib "user32" (ByVal x As Integer, ByVal y As Integer) As Integer Declare Function GetCursorPos Lib "User32" (ByRef lpPoint As Point) As Long End Class




Reply With Quote