Fyx的方法是对的,为何不采纳?<br>下面的例子可以显示Windows当前窗口的句柄:<br> Var<br> _Pt : TPoint;<br>procedure TForm1.Timer1Timer(Sender: TObject);<br>begin<br> Timer1.Interval:=101;<br> GetCursorPos(_Pt);<br> Label1.Caption:=Trim(IntToStr(WindowFromPoint(_Pt)));<br>end;<br>