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_window:HWND;
Text:array[0..255] of char;
begin
H_window:=GetWindow(Handle,GW_HWNDFIRST);
While H_window<>0 do
begin
if GETWindowText(H_window,@text,255)>0 then
memo1.Lines.Add(StrPas(@Text));
H_window:=GetWindow(H_Window,GW_HWNDNEXT);
end;
end;

end.


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM