0%

C# 获取鼠标双击间隔时间

引入DLL函数

1
2
3
[DllImport("user32.dll", EntryPoint = "GetDoubleClickTime")]

public extern static int GetDoubleClickTime();

完整代码,创建一个窗体拖入一个文本框控件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
[DllImport("user32.dll", EntryPoint = "GetDoubleClickTime")]

public extern static int GetDoubleClickTime();

public Form1()
{
InitializeComponent();
}



private void Form1_Load(object sender, EventArgs e)
{
textBox1.Text = Convert.ToString(GetDoubleClickTime());
}

觉得文章有用?请我喝杯咖啡~