Advertisement

05.31.2008 at 11:10AM PDT, ID: 23447180
[x]
Attachment Details

EnumchildWindows in Delphi.NET

Asked by zattz in Delphi.net Programming

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(Handle));
end;


procedure TForm4.Button1Click(Sender: TObject);
begin

WindowList := TList.Create;
      EnumchildWindows(26480938,@GetWindows, Longint(@TopWindow));
      for i := 0 to WindowList.Count - 1 do
      begin
         GetWindowText(HWND(WindowList[i]), Dest, sizeof(Dest) - 1);
         SendMessage(HWND(WindowList[i]), WM_GETTEXT, 2048, LongInt(@Buf));
          GetClassName(HWND(WindowList[i]), buf2, 255);
          memo1.lines.add(buf);
         end;

end;
Start Free Trial
[+][-]06.01.2008 at 04:40AM PDT, ID: 21686645

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Delphi.net Programming
Sign Up Now!
Solution Provided By: zattz
Participating Experts: 0
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628