Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15136

how do i mouse move within the app

$
0
0
i have code for vb6 and within the app you can move mouse dont matter if you move the form around the windows desktop the mouse will still hit the area you want it to go to.

Code:

Private Type POINTAPI
    X As Long
    Y As Long
End Type

Private Type RECT
    Left As Long
    Top As Long
    Right As Long
    Bottom As Long
End Type

Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Private Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long

Private Sub Command43_Click()
Dim rForm As RECT
    Dim p As POINTAPI
 Call GetWindowRect(Me.hwnd, rForm)
    p.X = ((rForm.Right - rForm.Left) / 6) + rForm.Left + 101
    p.Y = ((rForm.Bottom - rForm.Top) / 7) + rForm.Top
    SetCursorPos p.X, p.Y
    WaitSeconds (1)
    mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0
End Sub

how do i convert this to vb.net anyone thanks

Viewing all articles
Browse latest Browse all 15136

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>