function EnumWindowsProc(AHWnd: HWnd;<br> LPARAM: lParam): boolean; stdcall;<br>var<br> WndCaption: array[0..254] of char;<br>begin<br> GetWindowText(AHWnd, @WndCaption, 254);<br> mainform.lb_window.Items.Add(StrPas(WndCaption));<br> mainform.LB_object_hwnd.Items.Add(inttostr(ahwnd));<br> Result := True;<br>end;<br><br>procedure Tmainform.BB_findClick(Sender: TObject);<br>begin<br> lb_window.Items.Clear;<br> lb_object_hwnd.Items.Clear;<br> EnumWindows(@EnumWindowsProc, 0);<br>end;<br>