C# - Simulate mouse clicks with SendInput (codeproject implementation)

Published: 30 September 2022
on channel: JFLHV
5,731
39

How I simulate left and right mouse clicks in Windows apps with C# SendInput function. A download from codeproject.com is used to build functions for LeftClick and RightClick.

InputSender Download:
https://www.codeproject.com/Articles/...

C# Automation Playlist:
   • C# Automation  

private void LeftClick(int x, int y)
{
InputSender.SetCursorPosition(x, y);

InputSender.SendMouseInput(new InputSender.MouseInput[]
{
new InputSender.MouseInput
{
dwFlags = (uint)InputSender.MouseEventF.LeftDown
}
});

Thread.Sleep(100);

InputSender.SendMouseInput(new InputSender.MouseInput[]
{
new InputSender.MouseInput
{
dwFlags = (uint)InputSender.MouseEventF.LeftUp
}
});
}


On this page of the site you can watch the video online C# - Simulate mouse clicks with SendInput (codeproject implementation) with a duration of hours minute second in good quality, which was uploaded by the user JFLHV 30 September 2022, share the link with friends and acquaintances, this video has already been watched 5,731 times on youtube and it was liked by 39 viewers. Enjoy your viewing!