类似翻译软件取词是怎么实现的?
我想步骤大概是
获取鼠标位置---获取窗口句柄--获取窗口文字
要用那些API?怎么实现呢?
[解决办法]
var
P: TPoint;
h: THandle;
pText: PChar;
begin
GetMem(pText,128);
try
Windows.GetCursorPos(P);
h:=Windows.WindowFromPoint(P);
Windows.GetWindowText(h,pText,128);
Showmessage(StrPas(pText));
finally
FreeMem(pText);
end;
end;
[解决办法]
http://www.lihuasoft.net/article/show.php?id=233
http://www.2ccc.com/article.asp?articleid=884