C# 鼠标在固定位置移动
来源:互联网 发布:java telnet登录失败 编辑:程序博客网 时间:2024/05/16 10:42
[System.Runtime.InteropServices.DllImport("user32", EntryPoint = "ClipCursor")]
public extern static int ClipCursor(ref RECT lpRect);
[System.Runtime.InteropServices.DllImport("user32.dll", EntryPoint = "GetWindowRect")]
public extern static int GetWindowRect(int hwnd, ref RECT lpRect);
public struct RECT//声明参数的值
{
public int left;
public int top;
public int right;
public int bottom;
}
public void Lock(System.Windows.Forms.Form ObjectForm)
{
RECT _FormRect = new RECT();
GetWindowRect(ObjectForm.Handle.ToInt32(), ref _FormRect);
ClipCursor(ref _FormRect);
}
//恢复移动
public void UnLock()
{
RECT _ScreenRect = new RECT();
_ScreenRect.top = 0;
_ScreenRect.left = 0;
_ScreenRect.bottom = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Bottom;
_ScreenRect.right = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Right;
ClipCursor(ref _ScreenRect);
}
- C# 鼠标在固定位置移动
- c# 固定窗体位置 即窗体不能被鼠标移动
- 移动端固定位置
- 获取鼠标位置并在点击时跟随鼠标移动
- 获取鼠标移动位置
- C# 鼠标移动到指定位置,并且单击
- C# WPF 实现鼠标固定在指定范围内运动
- 在运行时通过鼠标拖动移动控件位置(c#)
- 在运行时通过鼠标拖动移动控件位置(c#)
- 在运行时通过鼠标拖动移动控件位置(c#)
- C# 设置鼠标位置
- C# 获得鼠标位置
- 移动鼠标到指定位置
- js获取鼠标移动位置
- DIV固定在页面某个位置,不随鼠标滚动而滚动
- 鼠标移动UIview 位置随着鼠标改变
- C# 获取鼠标在屏幕中的颜色和位置
- 实现在窗体内移动鼠标时,能够实时显示鼠标指针的位置
- 2010年5月21日(类型转换)
- Android SDK 1.5中文版 (Application基础—4)
- POJ 2719 Faulty Odomete(公式递推)
- 悲剧
- 开源框架 InstantObjects 的代码
- C# 鼠标在固定位置移动
- Android Provider
- 赋值一次到底消耗多少性能?
- 在GCC编译 a++
- 关于Symbian里面的mifconv ,(.mk和.miflist文件的作用和工作)
- 设计模式Mediator的C++实现源码
- Cisco IP电话软件的WINRTP
- 关于在symbian listbox中添加svg图片的问题
- 网络字节序与主机字节序