(*//
标题:获取其他进程中StatusBar的文本
说明:Window2000+Delphi6调试通过
设计:Zswang
支持:wjhu111@21cn.com
日期:2005-02-22
//*)

uses CommCtrl;
function GetStatusBarText(mHandle: THandle): string;
var
  vBuffer: array[0..$1000of Char;
  vSize: Integer;
  I: Integer;
  vCount: Integer;
  vProcessId: DWORD;
  vProcess: THandle;
  vPointer: Pointer;
  vNumberOfBytesRead: Cardinal;
begin
  Result := '';
  vCount := SendMessage(mHandle, SB_GETPARTS, 00);
  if vCount <= 0 then Exit;
  GetWindowThreadProcessId(mHandle, @vProcessId);
  vProcess := OpenProcess(PROCESS_VM_OPERATION or PROCESS_VM_READ or
    PROCESS_VM_WRITE, False, vProcessId);
  vPointer := VirtualAllocEx(vProcess, nil$1000, MEM_RESERVE or MEM_COMMIT,
    PAGE_READWRITE);
  try
    for I := 0 to vCount - 1 do
    begin
      vSize := SendMessage(mHandle, SB_GETTEXT, I, 0) + 1;
      SendMessage(mHandle, SB_GETTEXT, I, Integer(vPointer));
      ReadProcessMemory(vProcess, vPointer, @vBuffer[0],
        vSize, vNumberOfBytesRead);
      Result := Result + #9 + vBuffer;
    end;
    Delete(Result, 11);
  finally
    VirtualFreeEx(vProcess, vPointer, 0, MEM_RELEASE);
    CloseHandle(vProcess);
  end;
end{ GetStatusBarText }

//Example
procedure TForm1.FormCreate(Sender: TObject);
begin
  RegisterHotKey(Handle, 1, MOD_WIN, VK_F2);
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
  UnRegisterHotKey(Handle, 1);
end;
procedure TForm1.WMHOTKEY(var Msg: TWMHOTKEY);
begin
  case Msg.HotKey of
    1: Edit1.Text := GetStatusBarText(
      WindowFromPoint(Point(Mouse.CursorPos.X, Mouse.CursorPos.Y)));
  end;
end;

http://blog.csdn.net/zswang/article/details/297038

获取其他进程中StatusBar的文本的更多相关文章

  1. 获取其他进程中ListBox和ComboBox的内容

    (*// 标题:获取其他进程中ListBox和ComboBox的内容 说明:Window2000+Delphi6调试通过 设计:Zswang 支持:wjhu111@21cn.com 日期:2004-0 ...

  2. Windows获取其他进程中Edit控件的内容

    最近做的MFC项目中,有个获取其他进程中Edit控件内容的需求,本来以为是个很简单的问题,但是来来回回折腾了不少时间,发博记录一下. 刚开始拿到这个问题,很自然的就想到GetDlgItemText() ...

  3. 获取其他进程中“Internet Explorer_TridentCmboBx”的内容

    function GetTridentCmboBxText( // 获取其他进程中“Internet Explorer_TridentCmboBx”的内容   mHandle: THandle; // ...

  4. 【VC版】如何获取其他进程中ListView控件中的内容

    如果需要C#版的,可以看下我之前写的:C#如何获取其他程序ListView控件中的内容 获取其他进程的数据需要使用到以下几个函数: VirtualAllocEx() VirtualFreeEx() W ...

  5. 【iOS开发-22】navigationBar导航栏,navigationItem建立:获取导航栏中的基本文本和button以及各种跳跃

    (1)navigationBar导航栏可以被看作是self.navigationController一个属性导航控制器,它可以由点直接表示self.navigationController.navig ...

  6. 使用ptrace向已运行进程中注入.so并执行相关函数

    这个总结的很好,从前一个项目也用到这中技术 转自:http://blog.csdn.net/myarrow/article/details/9630377 1. 简介 使用ptrace向已运行进程中注 ...

  7. 使用ptrace向已运行进程中注入.so并执行相关函数(转)

    1. 简介 使用ptrace向已运行进程中注入.so并执行相关函数,其中的“注入”二字的真正含义为:此.so被link到已运行进程(以下简称为:目标进程)空间中,从而.so中的函数在目标进程空间中有对 ...

  8. 通过awk获取netstat命令中的进程号

    需要如下: 获取进程号

  9. jQuery截取字符串、日期字符串转Date、获取html中的纯文本

    jQuery截取字符串.日期字符串转Date.获取html中的纯文本. var com = com || {}; (function ($, com) { /* * 截取字符串 * @param st ...

随机推荐

  1. Fastjson 序列化,反序列化Map对象排序问题(字符串转map,map转字符串)

    背景 记录项目中遇到的 关于fastjson jsonobject转string乱序,string转jsonObject乱序问题的解决方案 fastJson issues 问题来源描述参见: http ...

  2. Browser security standards via access control

    A computing system is operable to contain a security module within an operating system. This securit ...

  3. WebHost failed to process a request.Memory gates checking failed because the free memory (140656640 bytes) is less than 5% of total memory

    WebHost failed to process a request. Sender Information: System.ServiceModel.ServiceHostingEnvironme ...

  4. Cordova 返回键切换后台

    这里需要用到 cordova-plugin-backbutton 这个插件 1.安装插件,命令窗口输入(当前目录是你项目所在的目录) cordova plugin add cordova-plugin ...

  5. vs中添加MySql实体集流程

    默认情况下只有下图: 首先需要下载mysql为vs和ef提供的驱动(可以去官网下载对应的版本) 然后打开vs开始添加实体类 首先在NuGet中安装MySql.Data和MySql.Data.Entit ...

  6. 假设做一个循环滚动UIScrollView

    先上效果图: 首先初始化: - (void)viewDidLoad { //加入最后一张图 用于循环 int length = 4; NSMutableArray *tempArray = [NSMu ...

  7. WPF图形/文字特别效果之一:交叉效果探讨(续)

    原文:WPF图形/文字特别效果之一:交叉效果探讨(续) 在"WPF图形/文字特别效果之一:交叉效果探讨"(http://blog.csdn.net/johnsuna/archive ...

  8. 深入python3 (Dive Into Python 3) 在线阅读与下载

    在线阅读:http://book.doucube.com/diveintopython3/  中文版 下载地址:https://github.com/downloads/diveintomark/di ...

  9. 峰识别 峰面积计算 peak detection peak area 源代码 下载

    原文:峰识别 峰面积计算 peak detection peak area 源代码 下载 Comparative  analysis  of  peak-detection  techniques   ...

  10. Java之"Mozilla Rhino"引擎(二)

    在Java中使用Rhino, 能让你使用类似Groovy, ECMAScript...等等之类的不同动态脚本语言, 其中值得推荐的是ECMAScript, 它是Rhino的默认实现, 同时也在JDK1 ...