function EnumWindowsProc(hWnd: HWND; lParam: LPARAM): BOOL; stdcall;<br>var<br> Buffer: Array[0..255] of Char;<br>begin<br> Result:=True;<br><br> with TMemo(lParam) do<br> begin<br> GetWindowText(hWnd,Buffer,255);<br> if StrLIComp(Buffer,'Form2',5)=0 then<br> Lines.Add(StrPas(Buffer)+' Handle: '+InttoStr(hWnd));<br> end;<br>end;<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>begin<br> EnumWindows(@EnumWindowsProc,Integer(Memo1));<br>end;<br>