Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi Titelleiste eines fremden fensters auslesen (https://www.delphipraxis.net/72141-titelleiste-eines-fremden-fensters-auslesen.html)

Van HelF 26. Jun 2006 22:49

Re: Titelleiste eines fremden fensters auslesen
 
so:
Delphi-Quellcode:
function EnumWinProc(Wnd: THandle; LParam: LongInt): Boolean; stdcall;
var
 WinCaption : string;
 Len: integer;
begin
 Result := True;
 Len := GetWindowTextLength(Wnd);
 SetLength(WinCaption, Len);
 GetWindowText(Wnd, PChar(WinCaption), Len+1);
 if Trim(WinCaption) <> '' then
   Form1.Listbox1.Items.Add(Format('%.6x : %s', [Wnd, WinCaption]));
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  EnumWindows(@EnumWinProc, 0);
end;

Van HelF 26. Jun 2006 22:54

Re: Titelleiste eines fremden fensters auslesen
 
habs hinbekommen:
Delphi-Quellcode:
function EnumWinProc(Wnd: THandle; LParam: LongInt): Boolean; stdcall;
var
 WinCaption : string;
 Len: integer;
   Buf : string;
begin
 Result := True;
 Len := GetWindowTextLength(Wnd);
 SetLength(WinCaption, Len);
 GetWindowText(Wnd, PChar(WinCaption), Len+1);
 if Trim(WinCaption) <> '' then
 begin
   SetLength(Buf,SendMessage(wnd,WM_GETTEXTLENGTH,0,0)+1);
   SendMessage(wnd,WM_GETTEXT,length(Buf),Integer(@buf[1]));
   form1.listbox1.items.add(buf);
 end;
end;


Alle Zeitangaben in WEZ +1. Es ist jetzt 04:45 Uhr.
Seite 2 von 2     12   

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz