• --:)欢迎访问锋网源码(:--
  • 首页
  • RSS订阅
  • 常用软件
  • 网页模板
  • 网站运作
  • 锋网学院
  • 繁體中文

  • 学院首页
  • 新闻资讯
  • 网站运营
  • 网站开发
  • 美工设计
  • 数据库类
  • 服务器类
  • 网络应用
  • 操作系统
  • 软件教学
编程开发   认证考试   网络安全   文章搜索: 高级搜索
会员登录/控制面版 您的位置: 学院首页 >> 编程开发 >> Delphi >> 文章内容
 

精彩推荐

 
 

本类推荐文章

 
 

本类阅读排行

  • 用Delphi编写DelTree程序
  • 远程控制篇:模拟按键
  • DELPHI中动态调用dll
  • 远程控制篇:通过IP地址得到..
  • 直接访问WebBrowser控件中的..
  • 在delphi把字符串分割成一维..
  • dbgrideh如何实现点击标题排..
  • INI文件的读写
  • Delphi字符串函数大全
  • 远程控制篇:服务端程序的隐..
  • 用Delphi制作中国式报表
  • 在delphi字符中包括单引号('..
  • 用DEPHI为应用软件建立注册机..
  • 怎样让程序延时
  • 压缩图像文件并转换成BMP格式..
  • 一个四舍五入函数
  • 创建Borland风格的漂浮式窗口..
  • 从当前的浏览器取得当前URL
  • fileStream
  • 获得Memo、RichEdit的光标位..
 
 

在delphi中如何限制鼠标的移动区域。

  • 日期:2007-10-21     人气:     出处:     作者:
  • 字体大小:
  • 小
  • 中
  • 大

下面把鼠标的移动区域限制在(100,100,200,200)

var rect:TRect;
begin
  rect.Left:=100;
  rect.Top:=100;
  rect.Bottom:=200;
  rect.Right:=200;
  windows.ClipCursor(@rect);



下面恢复鼠标的移动区域
  windows.ClipCursor(0);

具体的列子就不用举了吧,很简单的。嘻嘻嘻嘻嘻

在delphi中的帮助是这么写的:

The ClipCursor function confines the cursor to a rectangular area on the screen.
If a subsequent cursor position (set by the SetCursorPos function or the mouse)
lies outside the rectangle, Windows automatically adjusts the position to keep the
cursor inside the rectangular area.

BOOL ClipCursor(

    CONST RECT *lpRect     // pointer to structure with rectangle 
  );    


Parameters

lprc

Points to the RECT structure that contains the screen coordinates of the upper-
left and lower-right corners of the confining rectangle. If this parameter is
NULL, the cursor is free to move anywhere on the screen.



Return Values

If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

The cursor is a shared resource. If an application confines the cursor, it must
release the cursor by using ClipCursor before relinquishing control to another
application.
The calling process must have WINSTA_WRITEATTRIBUTES access to the window station.

相关文章
  • QQ帮你突破网吧硬盘访问限制
  • 局域网内盗用IP的安全问题
  • 邮件安全攻略:只要糖衣不要炮弹
  • 手机病毒的分类及其防范措施
  • 如何防止黒客远程盗取QQ密码
  • 始料未及,谁在控制电脑重新启动
  • 网络常见木马的手工清除方法
  • 魔高一尺 道高一丈
  • 防火墙日志记录让蠕虫病毒无处可逃
  • 提防他人动用电脑另有妙招
相关软件

  • 网友评论:
  • 查看所有评论
  • 我要发表评论
 

关于本站 | 广告联系 | 版权声明 | 网站地图 | 加入收藏 | 帮助中心 |

Copyright © 2006-2007 fwvv.net  程序支持:木翼  皖ICP备06004916号  

感谢:点击网络 联网科技 天盈信息 中国E速网 59互联  提供服务器及带宽赞助