ScreenToClient 坐标转换函数
来源:互联网 发布:数据挖掘用户属性 编辑:程序博客网 时间:2024/06/10 22:43
procedure TForm1.ButtonClick(Sender: TObject);
var
Rect:TRect;
lpPoint:TPoint;
begin
GetWindowRect(Button.Handle,Rect); //取得控件相对于屏幕的坐标,即屏幕坐标;
lpPoint:=Rect.TopLeft;
Windows.ScreenToClient(Form1.Handle,lpPoint); //屏幕坐标转换为窗体坐标;
//lpPoint:=ScreenToClient(Rect.TopLeft); //屏幕坐标转换为窗体坐标 同上效果一样
Edit.Text:=IntToStr(lpPoint.X);
Edit1.Text:=IntToStr(lpPoint.Y);
SetCursorPos(lpPoint.X,lpPoint.Y);
end;
附加:
GetCursorPos获取当前鼠标位置(屏幕坐标)
ScreenToClient从屏幕坐标转换为客户区坐标
GetWindowRect获取窗体大小
更新中。。。
- ScreenToClient 坐标转换函数
- MFC ScreenToClient坐标转换错误
- 坐标的相对转换ClientToScreen与ScreenToClient
- MFC的坐标转换GetClientRect/GetWindowRect/ClientToScreen/GetCursorPos/ScreenToClient
- MFC的坐标转换GetClientRect/GetWindowRect/ClientToScreen/GetCursorPos/ScreenToClient
- 坐标讨论:LPTODP, DPTOLP, ScreenToClient ,ClientToScreen .
- 几个WIindows函数。坐标转换
- ScreenToClient
- ScreenToClient
- ScreenToClient
- [cnblogs镜像]Unity 获取坐标函数 坐标转换函数
- ScreenToClient 与 CMainFrame非客户区坐标计算
- MapDialogRect函数,转换对话框坐标为像素坐标
- 设备坐标与逻辑坐标相互转换的两个函数
- cocos2dx 坐标转换相关函数应用演示
- UIView 坐标转换,认识convertRect函数
- 坐标转换
- 坐标转换
- 使用rope进行Python代码补全
- 通过3个程序分析数组与指针区别
- what is Mono?
- win7 linux 双系统引导修复
- 看一个做了10年软件的人转行的感想
- ScreenToClient 坐标转换函数
- Linux 5安装oracle10g 简易操作手册
- DBIF_RSQL_INVALID_RSQL (FAE AND IN cause this error)
- 雪佛兰新能源汽车超酷动画
- MySQL Limit的用法总结
- 分享我的书架:一个五年程序员的学习观
- 简单的回调例子
- 一个五年程序员的学习观
- Running system commands in Java applications