delphi 获取所有窗口标题


本文整理自网络,侵删。

 unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons;

type
TForm1 = class(TForm)
BitBtn1: TBitBtn;
Memo1: TMemo;
procedure BitBtn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.BitBtn1Click(Sender: TObject);
var
  h: HWnd;
  p: array[0..254] of char;
begin
  h := GetWindow(Handle, GW_HWNDFIRST);
  while h <> 0 do
  begin
    if GetWindowText(h, p, 255) > 0 then Memo1.Lines.Add(p);
    h := GetWindow(h, GW_HWNDNEXT);
  end;
end;

end.

相关阅读 >>

Delphi 下的通配符查找函数

Delphi检测程序是否在优盘上运行

[Delphi] 计算目录大小的函数,获得目录文件列表,计算文件的大小

Delphi xe8 无法进入android的调试状态

Delphi遍历所有控件

Delphi 字符串加密与解密函数

Delphi 如何确定活动桌面是否已启用

Delphi 提取字符串左侧内容

Delphi下遍历指定目录下指定类型文件的函数

Delphi urldownloadtofile 支持进度条

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



打赏

取消

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

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

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

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

评论

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