C
cyfflying
Unregistered / Unconfirmed
GUEST, unregistred user!
我上午刚写了段程序,代码可能有点笨,但QQ2003版通过了,具体如下<br>procedure TForm1.Button1Click(Sender: TObject);<br>var<br> mainhnd,sunhnd,fbuttonhandle:thandle;<br> butff:string;<br> hCurrentWindow:HWnd;<br> szText: array[0..254] of char;<br>begin<br> butff:=edit1.Text;//你要发送的内容<br> hCurrentWindow := GetWindow(Handle, GW_HWNDFIRST);<br> while hCurrentWindow <> 0 do<br> begin<br> if GetWindowText(hCurrentWindow, @szText, 255)>0 then<br> if (pos('发送消息',strpas(@sztext))>0) or (pos('对话模式',strpas(@sztext))>0) then<br> begin<br> mainhnd:=findwindow(nil,@sztext);<br> fbuttonhandle:=findwindowex(mainhnd,0,'button','发送(&s)');<br> mainhnd:=findwindowex(mainhnd,0,'AfxWnd42',nil);//这是新版真正的输入框<br> if mainhnd<>0 then<br> begin<br> sunhnd:=findwindowex(mainhnd,0,'RICHEDIT',nil);<br> if sunhnd<>0 then<br> begin<br> sendmessage(sunhnd,wm_settext,20,lparam(butff));<br> SendMessage(FButtonHandle,WM_LBUTTONDOWN,0,0);<br> SendMessage(FButtonHandle,WM_LBUTTONUP,0,0);<br><br> end;<br> end;<br> end;<br> hCurrentWindow:=GetWindow(hCurrentWindow, GW_HWNDNEXT);<br><br> end;<br>end;<br><br>希望这段代码别成为QQ尾巴进一步泛滥的源头,呵呵,我想现在流行的QQ尾巴可能也是这个工作原理,那么如何才能够拦截这样的程序呢,不知各位大侠有什么高见,分数我可以另开