❓ Sending fake user input

Posts 1–4 of 4 · Page 1 of 1
Sending fake user input to form only.
Ok I am making a mouse cursor bot and I just need this to finish the project I need something to send fake mouse movement/clicking and fake typing I don't know how to do this so I can minimize the program and it will still run.
I made a simple little project, hope it helps

This project i made allows u to send input by using these commands :

Left Click :
mouseclickingexample("LeftClick")
Right Click :
mouseclickingexample("RightClick")

Send Keys :
keyboardclickingexample("as many keys as you want instantly")

Set Mouse Location : (x,y)
cursor_possetexample(5, 5)
You will need all the private subs from this
Code:
Public Class Form1
    Private Declare Sub mouse_event Lib "user32.dll" (ByVal dwFlags As Integer, ByVal dx As Integer, ByVal dy As Integer, ByVal cButtons As Integer, ByVal dwExtraInfo As IntPtr)
    Private Sub mouseclickingexample(ByVal LeftClick_RightClick As String)
        Const MOUSEEVENTF_LEFTDOWN As Integer = 2
        Const MOUSEEVENTF_LEFTUP As Integer = 4
        Const MOUSEEVENTF_RIGHTDOWN As Integer = 6
        Const MOUSEEVENTF_RIGHTUP As Integer = 8
        If LeftClick_RightClick = "RightClick" Then
            mouse_event(MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, IntPtr.Zero)
            mouse_event(MOUSEEVENTF_RIGHTUP, 0, 0, 0, IntPtr.Zero)
        ElseIf LeftClick_RightClick = "LeftClick" Then
            mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, IntPtr.Zero)
            mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, IntPtr.Zero)
        Else
        End If
    End Sub

    Private Sub keyboardclickingexample(ByVal keyclicks As String)
        My.Computer.Keyboard.SendKeys(keyclicks)
    End Sub

    Private Sub cursor_possetexample(ByVal xpos As Integer, ByVal ypos As Integer)
        Cursor.Position = New Point(xpos, ypos)
    End Sub

    Private Sub Usage_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Usage_Button.Click
        'keyboard clicking usage :
        keyboardclickingexample("5")
        'or
        keyboardclickingexample("this is an example by lucasheer715")

        'mouse positions exampe (place where u wanna click)
        cursor_possetexample(50, 50)

        'mouse click example :
        'left click
        mouseclickingexample("LeftClick")
        'or right click
        mouseclickingexample("RightClick")
    End Sub
End Class
"...so I can minimize the program and it will still run."

I think SendMessage() maybe.
from msdn site: "Sends the specified message to a window or windows. The SendMessage function calls the window procedure for the specified window and does not return until the window procedure has processed the message."
SendMessage function (Windows)
google for demos. ie SendMessage mouse clicks , SendMessage keyboard, etc.
Are you trying to ask "how do I minimize my program while it's still running" or how to make "fake" movement of the mouse (which doesn't even make sense)?
Posts 1–4 of 4 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us