如何将鼠标锁定在一定的范围内呢? <br>请在Form中放置二个 Button, 然後分别为这两个按钮定义OnClick响应事件如下: <br>// 限制 <br>procedure TForm1.Button1Click(Sender: TObject); <br>var <br>rtButton2: TRect; <br>begin <br>rtButton2 := Button2.BoundsRect; <br>MapWindowPoints(handle, 0, rtButton2, 2); // 座标换算 <br>ClipCursor(@rtButton2); // 限制鼠标移动区域 <br>end; <br><br>// 还原 <br>procedure TForm1.Button2Click(Sender: TObject); <br>var <br>rtScreen: TRect; <br>begin <br>rtScreen := Rect(0, 0, Screen.Width, Screen.Height); <br>ClipCursor(@rtScreen); <br>end; <br>调用API将Ctr+Alt+Del屏蔽,再写程序将Ctr+Alt+Del按下,调用解锁对话框的窗口。<br>程序退出时再用API恢复Ctr+Alt+Del!