上面的代码有点太随手了,现为我调试通过的.<br>var<br> myhandle : THandle;//本地全局变量<br><br>function EnumerateChildWindows(hWnd: HWND; lParam: LPARAM): BOOL;stdcall;<br>var//枚举函数<br> windowCaption:array[0..254] of Char;<br>begin<br> GetWindowText(Hwnd,WindowCaption,255);<br> if WindowCaption ='取消' then<br> myhandle := hWnd;//找到的按钮句柄<br> Result:=true;<br>end;<br><br><br>procedure TForm1.Button1Click(Sender: TObject);<br>var<br> Hnd : HWnd;<br> myrect:Trect;//存放坐标<br>begin<br> Hnd := FindWindow( nil, '远程桌面连接');//找该程序窗体的句柄<br> if Hnd = 0 then exit;//没找到,退出<br> EnumChildWindows( Hnd, @EnumerateChildWindows, 0 );<br> Getwindowrect(myhandle,myrect);<br> label1.caption:=format('%d,%d,%d,%d',<br> [myrect.left,myrect.top,myrect.right,myrect.bottom]);<br>end;<br>///目前我只能得到屏幕下的坐标,不知道有没有得到客户坐标的函数?