C# click on the form's coordinate in the background

-1

I used this but not background. I used other codes but not solved my problems. What can I do?

[DllImport("user32.dll")]
static extern void mouse_event(int dwFlags, int dx, int dy,   
                               int dwData, int dwExtraInfo);

[Flags]
public enum MouseEventFlags
{
    LEFTDOWN = 0x00000002,
    LEFTUP = 0x00000004,
    MIDDLEDOWN = 0x00000020,
    MIDDLEUP = 0x00000040,
    MOVE = 0x00000001,
    ABSOLUTE = 0x00008000,
    RIGHTDOWN = 0x00000008,
    RIGHTUP = 0x00000010
}

public Form3()
{
    InitializeComponent();
    chromiumWebBrowser1.Load("google.com");
}

private void Form3_MouseUp(object sender, MouseEventArgs e)
{
    label1.Text = "X -c " + e.X + "Y -c " + e.Y;
}

private void button1_Click(object sender, EventArgs e)
{
    mouse_event((int)(MouseEventFlags.LEFTDOWN), 720, 440, 0, 0);
    mouse_event((int)(MouseEventFlags.LEFTUP), 720, 0, 0, 0);
}
c#
click
asked on Stack Overflow May 11, 2020 by Furkan Hatay • edited May 11, 2020 by marc_s

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0