//给你个简单的例子
procedure TForm1.Button1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var
m_Point : TPoint;
winhwnd : hwnd;
nmancount,ch :array[0..255] of char;
textLength : integer;
i : integer;
begin
if Button = mbLeft then
begin
GetCursorPos(m_Point);
winhwnd:=WindowFromPoint(m_Point);
edit3.Text := inttostr(winhwnd) ;
//Button1.Cursor := crDefault;
GetClassName(winhwnd,@nmancount,256);
edit1.Text := string(nmancount);
textLength := getwindowtextLength(winhwnd);
getwindowtext(winhwnd,@ch,256);
edit2.Text := string(ch);
end;
end;
这个应该是可以。