procedure TForm1.Timer1Timer(Sender: TObject);<br>var<br> rPos: TPoint;<br>begin<br> if boolean(GetCursorPos(rPos)) then<br> GetMousePosHwndAndClassName(rPos);<br>end;<br><br>procedure TForm1.GetMousePosHwndAndClassName(Sender: TPoint);<br>var<br> hWnd: THandle;<br> aName: array [0..255] of char;<br>begin<br> hWnd := WindowFromPoint(Sender);<br> NameLB.Caption := ’Handle : ’ + IntToStr(hWnd);<br><br> if boolean(GetClassName(hWnd, aName, 256)) then<br> ClassLB.Caption := ’ClassName : ’ + string(aName)<br> else<br><br> ClassLB.Caption := ’ClassName : not found’;<br>end;<br><br>procedure TForm1.FormCreate(Sender: TObject);<br>begin<br> Form1.FormStyle := fsStayOnTop;<br> Timer1.Interval := 50;<br>end;<br>给分行吗 等用~~~