遍历子窗体:<br>implementation<br>var Hchild: integer;<br><br>function EnumProc(Hwnd: THandle;lparam: LPARAM): boolean; stdcall;<br>var<br> lpText: Array[0..255] of char;<br>begin<br> Result := true;<br> GetClassName(hwnd,@lpText,255);<br> if (lptext)='Edit' then<br> begin<br> HChild := HWnd;<br> Result := false;<br> end;<br>end;<br>function TForm1.GetEditHandle(WinCap: string): integer;<br>var<br> hParent: THandle;<br> i: integer;<br>begin<br> Result := 0;<br> hChild := 0;<br> hParent := FindWindow(nil,pchar(WinCap));<br> if hParent=0 then exit;<br> EnumChildWindows(hParent,@EnumProc,0);<br> Result := hChild;<br>end;