一个API而已 : getfocus,帖我以前写一程序部分代码出来:<br> f1,f2,f3:longint;<br> S:string;<br> S:='字';<br> //得到当前焦点控减句柄发消息<br> f1:=GetForegroundWindow;<br> f2:=GetWindowThreadProcessId(f1,nil);<br> AttachThreadInput(GetCurrentThreadId,f2,true);<br> f3:=getfocus;<br> AttachThreadInput(GetCurrentThreadId,f3,false);<br> if f3 = 0 then Exit;<br> SendMessage(f3, $0286,(ord(S[1]) shl 8) + ord(S[2]) , 0);<br> 完整代码在:(Delphi盒子上面也有的,不过正在弄服务器)<br> http://www.playicq.com/dispdocnew.php?id=14925