Var
mPoint:TPoint;
Ret:LongInt;
mText:PChar;
mID:Integer;
Buf:Integer;
DTWND:HWND;
begin
GetMem(mText,1024);
try
GetCursorPos(mPoint);
DTWND:=WindowFromPoint(mPoint);
Ret:=SendMessage(DTWND,WM_GETTEXTLENGTH,0,0);
Buf:=LongInt(mText);
SendMessage(DTWND,WM_GETTEXT,1024,Buf);
Edit1.Text:=StrPas(mText);
finally
FreeMem(mText,1024);
end;
end;