通过枚举窗口控件句柄,然后再获得控件位置<br>EnumChildWindows(窗口句柄,@EnumChildProc,0);<br><br>//枚举过程<br>function EnumChildProc(AHWnd: HWnd;LPARAM: lParam): boolean; stdcall;<br>var<br> WndCaption: array[0..254] of char;<br> WndClassName: array[0..254] of char;<br> lpRect:TRect;<br>begin<br> GetWindowText(AHWnd, @WndCaption, 254); 获得控件名<br> GetClassName(AHWnd, @WndClassName, 254); 获得控件类名<br> GetWindowRect(AHWnd,lpRect) 控件大小,位置的Rect值<br><br> //继续枚举窗体内控件<br> EnumChildWindows(AHWnd, @EnumChildProc, LParam+1);<br> Result := True;<br>end;