B
bhcqh
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Timer1Timer(Sender: TObject);<br>var<br>lp:Tpoint;<br>curwnd,sendwnd,wnd:HWND;<br>FormThreadID,CWndThreadIDWORD;<br>begin <br> curWnd:=GetForegroundWindow();<br> FormThreadID:=GetCurrentThreadId();<br> CWndThreadID:=GetWindowThreadProcessId(curWnd, Nil);<br> AttachThreadInput(CWndThreadID,FormThreadID,true);<br> sendWnd:=GetFocus();<br> AttachThreadInput(CWndThreadID,FormThreadID,false);<br> postmessage(sendwnd,WM_CHAR,79,0);<br>end;<br>这段代码在窗口没有隐藏前是正常发送消息到正在活动的窗口的,隐藏再显示后就不能发送了,谁知道是什么原因啊