Does anybody have any examples of how to use EnumchildWindows in Delphi.NET?
The following win32 code does not work:
var
Form4: TForm4;
var WindowList:TList;
TopWindow:THandle;
i: Integer;
Dest: array[0..80] of char;
var Buf: array[0..2048] of char;
var Buf2: array[0..2048] of char;
implementation
{$R *.dfm}
function GetWindows(Handle: HWND; Info: Pointer): BOOL; stdcall;
begin
Result := True;
WindowList.Add(Pointer(Han
dle));
end;
procedure TForm4.Button1Click(Sender
: TObject);
begin
WindowList := TList.Create;
EnumchildWindows(26480938,
@GetWindow
s, Longint(@TopWindow));
for i := 0 to WindowList.Count - 1 do
begin
GetWindowText(HWND(WindowL
ist[i]), Dest, sizeof(Dest) - 1);
SendMessage(HWND(WindowLis
t[i]), WM_GETTEXT, 2048, LongInt(@Buf));
GetClassName(HWND(WindowLi
st[i]), buf2, 255);
memo1.lines.add(buf);
end;
end;
Start Free Trial