Hi Daniel,
i tryed to write that method, but it throws MissingMethodException when
mouse_event is called... When i add 'mouse_event( 0x8002, mx , my, 0, 0)'
to
watches in VisualStudio, it's evaluated with no errors.
[DllImport("coredll.dll")]
private static extern void mouse_event( uint flags, uint dx, uint dy, uint
dwData, uint extraInfo);
public static void MouseClick( int x, int y, System.Windows.Forms.Form
sender)
{
System.Drawing.Point p = sender.PointToScreen( new System.Drawing.Point(
x,y));
int ma = 65535 / Screen.PrimaryScreen.Bounds.Width;
int mb = 65535 / Screen.PrimaryScreen.Bounds.Height;
uint mx = (uint)(ma * p.X);
uint my = (uint)(mb * p.Y);
mouse_event( 0x8002, mx , my, 0, 0);
mouse_event( 0x8004, mx , my, 0, 0);
}
Daniel Moth said: