Answers for "how to detect mouse stopped moving on screen c#"

C#
0

how to detect mouse stopped moving on screen c#

public partial class Form1 : Form
{
    Timer timer = new Timer();

    public Form1()
    {
        InitializeComponent();

        timer.Interval = 10;
        timer.Tick += Timer_Tick;

        timer.Start();
    }

    private void Timer_Tick(object sender, EventArgs e)
    {
        // do here whatever you want to do

        // just for testing...
        GetCursorPos(out Point lpPoint);
        this.Text = lpPoint.X + ", " + lpPoint.Y;
    }

    [DllImport("user32.dll")]
    public static extern bool GetCursorPos(out Point p);
}
Posted by: Guest on October-04-2020

Code answers related to "how to detect mouse stopped moving on screen c#"

C# Answers by Framework

Browse Popular Code Answers by Language