Delphi 获取当前鼠标下的控件内容
2024-08-25 07:53:00
Delphi 获取当前鼠标下的控件内容
主要函数:
GetCursorPos;//获取鼠标的位置
WindowFromPoint;//获取制定point下的handle
GetClassName;//获取类的名字
function TForm1.GetEditText: string;
var
Point: TPoint;
Name: array[0..255] of Char;
Buffer: array[0..1023] of Char;
AHandle: THandle;
begin
//取得鼠标位置
GetCursorPos(Point);
//取得当前窗口句柄
AHandle := WindowFromPoint(Point);
GetClassName(AHandle, Name, Length(Name));
if AHandle = Self.Handle then
Exit;
SendMessage(AHandle, WM_GETTEXT, 1023, Integer(@Buffer));
Caption := StrPas(Name);
Result := StrPas(Buffer);
end;
procedure TForm1.tmr1Timer(Sender: TObject);
begin
mmo1.Lines.Text := GetEditText;
end;
https://blog.csdn.net/lwstar23133/article/details/6773883
最新文章
- UILabel 根据文本内容设置frame
- AngularJs的UI组件ui-Bootstrap分享(十四)——Carousel
- iscsi: 环境搭建
- struts2基础——最简单的一个例子
- NBUT 1010 魔法少女(DP)
- IIS Server is too busy 解决方法(IIS6)
- Ubuntu Vim YouCompleteMe 安装
- android打包签名介绍
- [Machine Learning] Probabilistic Graphical Models:一、Introduction and Overview(1、Overview and Motivation)
- System.in与System.out(标准输入与标准输出)详解
- Advanced Installer 9.8打包实录
- 分布式版本控制系统Git-----7.Git 使用git rebase合并多次commit
- ios协议和委托
- [leetcode]984. 不含 AAA 或 BBB 的字符串
- SpringBoot学习历程
- maven在Idea建立工程,运行出现Server IPC version 9 cannot communicate with client version 4错误
- SQL复制表操作
- Spark2 生存分析Survival regression
- UVa 11093 环形跑道(模拟)
- python使用分治法找序列最大值
热门文章
- Could not locate executable null\bin\winutils.exe in the Hadoop binaries解决方式 spark运行wordcoult
- python---列表、元祖、字典的区别和常用方法
- BZOJ1433 [ZJOI2009]假期的宿舍 二分图匹配 匈牙利算法
- IDEA控制台问题:At least one JAR was scanned for TLDs yet contained no TLD
- PAT (Basic Level) Practise - 写出这个数
- sql 的一些总结
- java的conllections.sort排序
- 20165220实验二《Java面向对象程序设计》
- hdu1285 确定比赛名次【拓扑排序】
- vue组件通信那些事儿