本文整理自网络,侵删。
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读取webbrowse中的图片显示在image中
Delphi 创建win桌面快捷方式,实现360桌面图标数字提示 或 类似安卓的右上角的数字提示
更多相关阅读请进入《Delphi》频道 >>