获取其他进程中ListBox和ComboBox的内容
(*//
标题:获取其他进程中ListBox和ComboBox的内容
说明:Window2000+Delphi6调试通过
设计:Zswang
支持:wjhu111@21cn.com
日期:2004-03-25
//*)
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, , );
for I := to vItemCount - do begin
SetLength(S, SendMessage(mHandle, LB_GETTEXTLEN, I, ));
SendMessage(mHandle, LB_GETTEXT, I, Integer(@S[]));
mStrings.Add(S);
end;
SetLength(S, );
finally
mStrings.EndUpdate;
end;
Result := True;
end; { GetListBoxText }
function GetComboBoxText(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, CB_GETCOUNT, , );
for I := to vItemCount - do begin
SetLength(S, SendMessage(mHandle, CB_GETLBTEXTLEN, I, ));
SendMessage(mHandle, CB_GETLBTEXT, I, Integer(@S[]));
mStrings.Add(S);
end;
SetLength(S, );
finally
mStrings.EndUpdate;
end;
Result := True;
end; { GetComboBoxText }
//Example
procedure TForm1.FormCreate(Sender: TObject);
begin
RegisterHotKey(Handle, , MOD_WIN, VK_F2);
RegisterHotKey(Handle, , MOD_WIN, VK_F3);
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
UnRegisterHotKey(Handle, );
UnRegisterHotKey(Handle, );
end;
procedure TForm1.WMHOTKEY(var Msg: TWMHOTKEY);
begin
case Msg.HotKey of
:
GetListBoxText(
WindowFromPoint(Point(Mouse.CursorPos.X, Mouse.CursorPos.Y)),
MemoText.Lines);
:
GetComboBoxText(
WindowFromPoint(Point(Mouse.CursorPos.X, Mouse.CursorPos.Y)),
MemoText.Lines);
end;
end;
获取其他进程中ListBox和ComboBox的内容的更多相关文章
- Windows获取其他进程中Edit控件的内容
最近做的MFC项目中,有个获取其他进程中Edit控件内容的需求,本来以为是个很简单的问题,但是来来回回折腾了不少时间,发博记录一下. 刚开始拿到这个问题,很自然的就想到GetDlgItemText() ...
- 获取其他进程中“Internet Explorer_TridentCmboBx”的内容
function GetTridentCmboBxText( // 获取其他进程中“Internet Explorer_TridentCmboBx”的内容 mHandle: THandle; // ...
- 获取其他进程中StatusBar的文本
(*// 标题:获取其他进程中StatusBar的文本 说明:Window2000+Delphi6调试通过 设计:Zswang 支持:wjhu111@21cn.com 日期:2005-02-22 // ...
- 【VC版】如何获取其他进程中ListView控件中的内容
如果需要C#版的,可以看下我之前写的:C#如何获取其他程序ListView控件中的内容 获取其他进程的数据需要使用到以下几个函数: VirtualAllocEx() VirtualFreeEx() W ...
- 使用ptrace向已运行进程中注入.so并执行相关函数
这个总结的很好,从前一个项目也用到这中技术 转自:http://blog.csdn.net/myarrow/article/details/9630377 1. 简介 使用ptrace向已运行进程中注 ...
- 使用ptrace向已运行进程中注入.so并执行相关函数(转)
1. 简介 使用ptrace向已运行进程中注入.so并执行相关函数,其中的“注入”二字的真正含义为:此.so被link到已运行进程(以下简称为:目标进程)空间中,从而.so中的函数在目标进程空间中有对 ...
- 通过awk获取netstat命令中的进程号
需要如下: 获取进程号
- C#中如何获取其他进程的命令行参数 ( How to get other processes's command line argument )
Subject: C#中如何获取其他进程的命令行参数 ( How to get other processes's command line argument )From: jian ...
- winform中的ListBox和ComboBox绑定数据
将集合数据绑定到ListBox和ComboBox控件,界面上显示某个属性的内容 //... //自定义了Person类(有Name,Age,Heigth等属性) List<Person> ...
随机推荐
- 植物大战僵尸中文第二版和年度版 游戏分析及delphi源码
00413184 |. E8 77E30100 |CALL PlantsVs.00431500 ; 地上的物品00413189 |. 8D7424 10 ...
- How to add EDT relation table[AX2012]
setp 1. First create New Edit. setp 2.Create New Table First Table Name is NParentRel then drag and ...
- python自学笔记二
:#进入循环重输文0件名 pass else:#退出循环,等待创建 break fobj = open(fname,'a')#打开或创建文件 #接下来写入文件 all = [] print('ente ...
- Game Tutorials
SDL: http://www.sdltutorials.com/tutorials http://lazyfoo.net/ http://panda3d.noie.name/ http ...
- Configure Log Shipping
准备工作 两台装有的Windows Server 2012R2以及SQL Server 2012的服务器 下载评估版 Windows Server 2012 R2 下载 Microsoft SQL S ...
- ASP.NET中利用Split实现对Checkbox的字符串分离放到DataTable里面
一.背景 昨天唐欢问了我一个问题: 现在有一个CheckBox和一个Label如下图: 要实现选中CheckBox,点击下面打印按钮的时候要做成这个样子的如下图: 简单的说就是档案编号作为表中的一个列 ...
- synchronized关键字使用剖析
synchronized关键字,代表这个方法加锁,相当于不管哪一个线程(例如线程A),运行到这个方法时,都要检查有没有其它线程B(或者C. D等)正在用这个方法,有的话要等正在使用synchroniz ...
- Log.i()的用法
2011-04-16 09:44 17486人阅读 评论(4) 收藏 举报 androidlayoutbuttonstringencodingeclipse 在调试代码的时候我们需要查看调试信息,那我 ...
- js eval()执行传参函数的写法
.cs public class Message<T> { // 数据总数 public int? Total { get; set; } // 关键数据 public List<T ...
- 1452: [JSOI2009]Count - BZOJ
Description Input Output Sample Input Sample Output 1 2HINT 一开始还想什么离线做,其实不用,空间足够,我们直接开100个二维树状数组,然后就 ...