如何按QQ号找到并关闭QQ? ( 积分: 200 )

  • 主题发起人 moonight59
  • 开始时间
N久没人管了,自己顶起来,看看还有人帮忙没有
 
我也想知道,帮你顶
 
楼上那位karlbyte,怎么就不来了?我还想知道分析的结果呢!
 
unit Unit1;<br><br>interface<br><br>uses<br> &nbsp;Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,<br> &nbsp;Dialogs, ExtCtrls;<br><br>type<br> &nbsp;TForm1 = class(TForm)<br> &nbsp; &nbsp;Timer1: TTimer;<br> &nbsp; &nbsp;procedure Timer1Timer(Sender: TObject);<br> &nbsp;private<br> &nbsp; &nbsp;{ Private declarations }<br> &nbsp;public<br> &nbsp; &nbsp;{ Public declarations }<br> &nbsp;end;<br><br>var<br> &nbsp;Form1: TForm1;<br><br>implementation<br><br>{$R *.dfm}<br><br>procedure TForm1.Timer1Timer(Sender: TObject);<br>var<br> hMemo, &nbsp;HWindow,: THandle; //句柄变量<br> &nbsp; szText &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : Array[0..255] Of char; &nbsp; //得到的字符串<br> &nbsp; MyText &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : String; &nbsp;//发送的字符串<br>Begin<br> &nbsp; HWindow := 0;//从零开始,即从第一个字窗体开始遍历查找<br><br><br><br> &nbsp; While true Do<br> &nbsp; &nbsp; &nbsp;Begin<br><br><br><br> &nbsp; &nbsp; &nbsp; &nbsp; //找是#32770(对话框)的窗体<br> &nbsp; &nbsp; &nbsp; &nbsp; HWindow := FindWindowEx(0, HWindow, '#32770', Nil);<br> &nbsp; &nbsp; &nbsp; &nbsp; If HWindow &lt;&gt; 0 Then<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Begin<br><br><br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hRichEdit := FindWindowEx(hwindow, 0, 'button', '登录');<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If hRichEdit &lt;&gt; 0 Then<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Begin<br>if &nbsp;hRichEdit&lt;&gt;0 then<br>begin<br>senmessage(HWindow,wm_close,0,0);//关QQ<br>end;<br><br><br><br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;End;<br> &nbsp; &nbsp; &nbsp;End;<br><br> &nbsp; &nbsp;end;<br><br>end.<br><br><br>可能有错........我刚刚写的.
 
老兄这样不行!这样是关闭所有的QQ了,并不能按照QQ号关闭!<br>不过还是多谢!
 
顶起来,等待高手。。。
 
哦,jjm1227把关闭所有QQ窗口的代码都给了,剩下的就是获取每个窗口标题,如果pos('目标QQ号',title)&gt;0就关闭就可以了啊。
 
to moonight59:<br>用LumaQQ作为客户端,它在每个已登录的QQ窗口的标题栏显示QQ号码,你想关哪个就关哪个
 
to hzxhzx123: 纸上谈兵说得轻巧,你试试?你能把QQ的号码在标题栏上找到?<br><br>to bhg007: 你这个说了等于不说!
 
方法不中意,表骂我。<br>type temp=record<br> &nbsp;id:string; &nbsp;//记录QQ号码<br> &nbsp;myHandle:HWND;//凳录成功后,记录主窗体句柄<br>end;<br>function searchID(id:string):boolean;<br>var<br> &nbsp;i:integer;<br>begin<br> &nbsp;result:=false;<br> &nbsp;for i:=0 to QQsum-1 do<br> &nbsp;begin<br> &nbsp; &nbsp;if QQ.id=id then <br> &nbsp; &nbsp;begin<br> &nbsp; &nbsp; &nbsp;sendMessage(QQ.myHandle,WM_CLOSE,0,0);<br> &nbsp; &nbsp; &nbsp;result:=true;<br> &nbsp; &nbsp; &nbsp;exit; &nbsp; <br> &nbsp; &nbsp;end;<br> &nbsp;end;<br> &nbsp;<br>end;
 
啥意思哦?我现在要找系统里面运行了哪些QQ号哦!
 
哦,QQ的号码在标题栏上找不到,那就找他下面的子窗体呗,你还要别人把代码给你写好?
 
大家平心静气一些嘛
 
to moonight59:<br> &nbsp;你是不是一定要用腾讯的客户端?,我原先也是想用腾讯的,但它的窗口关闭后,进程仍在,所以你一定要用的话,可能会费很多时间,我用LuMaQQ是为了根据QQ号自动登录和关闭,要不你把要关闭QQ的原因说出来,大家再研究一下
 
to bhg007:<br>当然要用腾讯的客户端。<br>我写这个程序不是自己一个人用,所以不能说用Luma就行了,这个如果研究不出来就算了,但是能搞出来就要努力。<br>相信有办法搞出来的,因为TIMPlatform就是拥有这个功能的。[:)]
 
》但是可以通过它在系统托盘里的图标的tip找到对应的进程么?<br> &nbsp;可以考虑这个思路<br>wndnt=FindWindowEx:):FindWindow(&quot;Shell_TrayWnd&quot;, NULL), 0,&quot;TrayNotifyWnd&quot;,NULL);<br> wndpager=FindWindowEx(wndnt,NULL,&quot;SysPager&quot;,NULL);<br> ht=FindWindowEx(wndpager,NULL,&quot;ToolbarWindow32&quot;,NULL);<br>再往下,我就不知道怎么找到tips了。
 
我也想知道啊。最近在做个QQ外挂
 
来自:hzxhzx123, 时间:2005-8-15 12:28:16, ID:3167393<br>哦,QQ的号码在标题栏上找不到,那就找他下面的子窗体呗,你还要别人把代码给你写好? &nbsp;<br><br>To hzxhzx123:<br>你难道不知道 QQ的号码在标题栏上 是画上去的,您总是觉得问题容易,其实。。。。。
 
要是QQ2005的版本,就可以<br><br><br>因为,QQ2005的子窗体中就有QQ号
 

Similar threads

D
回复
0
查看
792
DelphiTeacher的专栏
D
D
回复
0
查看
746
DelphiTeacher的专栏
D
D
回复
0
查看
732
DelphiTeacher的专栏
D
顶部