Delphi 获取其它软件的TListBox句柄,怎么取得ListBox中的数据


本文整理自网络,侵删。

 
//感谢冰力不足 提供
function GetListBoxText(mHandle: THandle; mStrings: TStrings): Boolean;
var
vItemCount: Integer;
I: Integer;
S: string;
begin
Result := False;
if not Assigned(mStrings) then Exit;
mStrings.BeginUpdate;
try
mStrings.Clear;
vItemCount := SendMessage(mHandle, LB_GETCOUNT, 0, 0);
for I := 0 to vItemCount - 1 do
begin
SetLength(S, SendMessage(mHandle, LB_GETTEXTLEN, I, 0));
SendMessage(mHandle, LB_GETTEXT, I, Integer(@S[1]));
mStrings.Add(S);
end;
SetLength(S, 0);
finally
mStrings.EndUpdate;
end;
Result := True;
end;

相关阅读 >>

Delphi xe2 - 实现主窗口在任务栏上不显示

Delphi中关于canvas.textout的用法

Delphi获取控件界面图像“新招”

Delphi 修改快捷方式

Delphi 中文字符串函数问题rightstr

Delphi 使用 lockbox 做加密解密

Delphi源码一个对字符加密解密的实例

Delphi 使用windows api(wincrypt)计算文件md5哈希,支持大文件

Delphi 复制动态数组

Delphi 把mp3做背景音乐

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...