class Program
{
[StructLayout(LayoutKind.Sequential)]
public struct tagRECT
{
/// LONG->int
public int left;
/// LONG->int
public int top;
/// LONG->int
public int right;
/// LONG->int
public int bottom;
}
/// Return Type: BOOL->int
///lpRect: RECT*
[DllImport("user32.dll", EntryPoint = "ClipCursor")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool ClipCursor([In] IntPtr lpRect);
/// <summary>
/// 应用程序的主入口点。
c#设置鼠标无法使用和启用鼠标
最新推荐文章于 2024-07-24 08:23:48 发布
本文介绍了如何在C#中通过调用接口设置鼠标为禁用或启用状态,特别是在处理大量数据或读取数据时,利用多线程句柄将鼠标设置为忙碌状态,待操作完成后再恢复原状。
摘要由CSDN通过智能技术生成