试试这个:<br>procedure TFrmMain.Timer1Timer(Sender: TObject);<br>var<br> P:TPoint;<br> Hwnd:THandle;<br>begin<br> GetCursorPos(P);<br> Hwnd:=WindowFromPoint(P);<br> tex_Hwnd.Text:=IntToStr(Hwnd);<br> if Hwnd<>0 then<br> EnumChildWindows(Hwnd, @yourproc, 0);<br>end;