procedure TForm1.Formshow(Sender: TObject);var
rt: TRect;
begin
rt:= panel1.BoundsRect;
MapWindowPoints(handle, 0, rt, 2);
// 座标换算
ClipCursor(@rt);
// 限制鼠标移动区域
end;如果写成MapWindowPoints(handle, 0, rt, 3);则可限制鼠标,但运行时会跳出一个消息窗口说有有错误,不过可运行.
rt: TRect;
begin
rt:= panel1.BoundsRect;
MapWindowPoints(handle, 0, rt, 2);
// 座标换算
ClipCursor(@rt);
// 限制鼠标移动区域
end;如果写成MapWindowPoints(handle, 0, rt, 3);则可限制鼠标,但运行时会跳出一个消息窗口说有有错误,不过可运行.
解决方案 »
- update多个字段
- 谁能帮我看看该控件如何装才能成功
- 怎样动态连接上SQL 数据库?
- 如何使主窗口初始显示为最大化并屏蔽最大化,最小化按钮?
- 安装DVD解压卡后是否可用MEDIAPLAYER控件直接播放*.VOB文件?
- 如何在fastreport的memo中画斜线?(在线)
- ADO问题,急求help
- 都吃了没?我问一下 都谁用过DBExpress啊
- 欢迎UP,如何显示动态图标就是图标闪烁(是标题栏上的图标) UP有分!!
- TQuery的问题
- 用ServerSocket和ClinetSocket怎样实现QQ那样,程序运行后自动接收信息?
- Excel高手帮助:打开只读的Excel模板,可是Excel确总新建一个模板实例文件xls!
var
rtButton2: TRect;
begin
rtButton2 := Bevel1.BoundsRect;
MapWindowPoints(handle, 0, rtButton2, 2);
ClipCursor(@rtButton2);
end;
然后再消息处理中执行你的代码
我说的也不一定准确,去看看吧
HWND hWndFrom, // handle to source window
HWND hWndTo, // handle to destination window
LPPOINT lpPoints, // array of points to map
UINT cPoints // number of points in array
);
lpPoints
[in/out] Pointer to an array of POINT structures that contain the set of points to be converted. The points are in device units. This parameter can also point to a RECT structure, in which case the cPoints parameter should be set to 2.最后一句看看