设为首页  
联系我们  
加入收藏  
网页制作 冲浪宝典 图形图像 操作系统 软件教学 编程开发 认证考试 安全技术 站长专区 文学驿站 娱乐天地 游戏天地 办公软件
文章搜索
您的位置: 首页 >> 文章首页 >> 编程开发 >> Delphi >> 在delphi中如何限制鼠标的移动区域。
精品推荐
Delphi点击TOP10
·Delphi2005可以下载了
·用Delphi实现整个网站图片的极速下载
·制作QQ消息炸弹
·TextFile读写
·首次发布Delphi7汉化帮助
·用delphi实现冰河的远程屏幕操作功能
·Delphi的优点
·systemparametersinfo详细用法
·Delphi 6 IDE的运行时抓图及简介
·delphi实现批量缩略图生成工具开发代码
编程开发点击TOP10
·ASP.NET 程序中常用的三十三种代码
·利用ASP.NET构建网上考试系统
·C#版的网站新闻发布系统
·(转)23种设计模式汇集
·设计ASP.NET新闻管理系统
·深山红叶袖珍PE工具箱V16正式版
·我的.NET书架 (入门篇)
·java笔试题
·网页打印问题,打印设置,打印预览,打印分页,纵打,横打及页面的边距
·.NET:是什么?将走向哪里?
精选专题

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

作者: 来源:网络文章 时间:2005-12-14 17:23:45


下面把鼠标的移动区域限制在(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.




在delphi中如何限制鼠标的移动区域。 相关文章:
在delphi中如何限制鼠标的移动区域。 相关软件:
特别声明:本站除部分特别声明禁止转载的专稿外的其他文章可以自由转载,但请务必注明出处和原始作者。文章版权归文章原始作者所有。对于被本站转载文章的个人和网站,我们表示深深的谢意。如果本站转载的文章有版权问题请联系编辑人员,我们尽快予以更正。
转载请注明来源:http://www.xgdown.com