c#獲取光標在屏幕中位置的簡單實例
更新時間:2013年12月24日 15:28:29 作者:
這篇文章主要介紹了c#獲取光標在屏幕中位置的簡單實例,有需要的朋友可以參考一下
需要調用win32api,winform、wpf通用
代碼如下:
復制代碼 代碼如下:
[DllImport("user32.dll")]
public static extern bool GetCursorPos(out POINT lpPoint);
[StructLayout(LayoutKind.Sequential)]
public struct POINT
{
public int X;
public int Y;
public POINT(int x, int y)
{
this.X = x;
this.Y = y;
}
}
相關文章
使用 BenchmarkDotNet 對 C# 代碼進行基準測試
這篇文章主要介紹了使用 BenchmarkDotNet 對 C# 代碼進行基準測試,幫助大家更好的理解和學習使用c#,感興趣的朋友可以了解下2021-03-03

