[C# Discussion] Virtual mouse movement and click. Without moving the real cursor

ldg2002

Registered Member
Joined
Jun 5, 2012
Messages
66
Reaction score
6
Hi guys, I would like to be able to simulate a movement and a click of the mouse, without using the real mouse. i would use a virtual mouse, because even if my application's launch 10 processes at the same time, must be able to perform each movement and clicks in different windows.i mean a ghost mouse, 'cause every process that i launch must have a personal mouse
thanks
 
Well you can records current mouse work and play it! & I don't seen something like this!
 
Are you trying to click on buttons in a web browser or buttons on a desktop application?
 
Hi! i'm trying to click on awesomium webcontrol. i've 10/20 process istances and i need a ghost(virtual,ecc...) mouse for every window. thank you so much for the help!
 
try something like this;)

Code:
using System;
using System.Windows.Forms;
using System.Runtime.InteropServices;

public class Form1 : Form
{
  [DllImport("user32.dll", CharSet=CharSet.Auto, CallingConvention=CallingConvention.StdCall)]
  public static extern void mouse_event(uint dwFlags, uint dx, uint dy, uint cButtons, uint dwExtraInfo);

  private const int MOUSEEVENTF_LEFTDOWN = 0x02;
  private const int MOUSEEVENTF_LEFTUP = 0x04;
  private const int MOUSEEVENTF_RIGHTDOWN = 0x08;
  private const int MOUSEEVENTF_RIGHTUP = 0x10;

public void DoMouseClick()
  {
     //Call the imported function with the cursor's current position
     int X = Cursor.Position.X;
     int Y = Cursor.Position.Y;
     mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, X, Y, 0, 0);
  }
}


however this is NOT a virtual mouse, i can deep further to build such application. If you want me too i can send you the source once it's done.
 
thank you guest, i have been looking into this for a bit. i appreciate it alot. i would pm you but i cant
 
just add me on skype instead, im wiling to hep you out! MysteryGuest18 is my skype name.
 
Back
Top