标题:一个关于SendMessage的问题,大家给我看看这里出了什么问题[已解决,源码14楼 ...
只看楼主
flyly
Rank: 1
等 级:新手上路
帖 子:254
专家分:0
注 册:2006-11-13
得分:0 
思路错!这个思路是实现不了的,对与别的程序是可以的,但对QQ,不行!

2006-11-16 13:44
俺老虎
Rank: 1
等 级:新手上路
帖 子:78
专家分:0
注 册:2005-9-15
得分:0 
5555~~~flyly 提供一下思路如何....越说越急人了~

http://www. 爱博客 只要一分钟,建立你自己的博客网站 完全免费哦~
2006-11-16 13:58
simpson
Rank: 3Rank: 3
等 级:论坛游民
威 望:7
帖 子:863
专家分:17
注 册:2006-11-16
得分:0 

全国最大的 Java专业电子书免费分享[url]http:///in.asp?id=xrmao[/url]
2006-11-17 15:57
俺老虎
Rank: 1
等 级:新手上路
帖 子:78
专家分:0
注 册:2005-9-15
得分:0 

谢谢..13楼的兄弟....

现在能成功得到了...我将源码全部发出来.....人人为我,我为人人!

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)
'Private Const WM_GETTEXT = &H7D
Private Const WM_GETTEXT = &HD
Private Const WM_GETTEXTLENGTH = &HE

Private Sub Form_Load()
Timer1.Interval = 1000
End Sub

Private Sub Timer1_Timer()
On Error Resume Next
Dim sText As String * 255
Dim TextObj As Long
Dim txtLendth As Long, txtBuff As String

TheWindow = GetForegroundWindow '获得当前窗口句柄

If TheWindow = 0 Then Exit Sub
thewindow_title = Left$(sText, GetWindowText(TheWindow, sText, 255)) '得到聊天窗口标题~
chatobj = thewindow_title

'Debug.Print thewindow_title

If InStr(thewindow_title, "聊天中") <> 0 Or InStr(thewindow_title, "- 群") <> 0 Or InStr(thewindow_title, "查看消息") <> 0 Then
TextObj = FindWindowEx(TheWindow, 0, "#32770", vbNullString) '通用对话框的类
If TextObj = 0 Then Exit Sub
TextObj = FindWindowEx(TextObj, 0, "RichEdit20A", vbNullString) '聊天框的类
If TextObj = 0 Then Exit Sub
txtLength = SendMessage(TextObj, WM_GETTEXTLENGTH, ByVal CLng(0), ByVal CLng(0))
txtBuff = Space(txtLength)
retVal = SendMessage(TextObj, 13, ByVal txtLength + 1, ByVal txtBuff)
Text1 = Left(txtBuff, retVal) & vbCrLf & vbCrLf & "以上聊天对象为:" & chatobj
Else
Exit Sub
End If

End Sub


http://www. 爱博客 只要一分钟,建立你自己的博客网站 完全免费哦~
2006-11-17 18:17
wyy
Rank: 1
等 级:新手上路
帖 子:23
专家分:0
注 册:2006-11-13
得分:0 

不顶用么!!!

2006-11-21 13:01
Liaof
Rank: 1
等 级:新手上路
帖 子:32
专家分:0
注 册:2007-3-18
得分:0 
不错借鉴一下。、
2007-03-18 19:56
tinwin
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2007-6-25
得分:0 
先顶下在说..
2007-06-25 17:58
fqqklwj
Rank: 1
等 级:新手上路
帖 子:15
专家分:0
注 册:2007-4-22
得分:0 

嗯,先顶一下
让我很羡慕会使用API函数,我也要学会


学习中真是受益匪浅,努力~努力~
2007-07-20 22:06



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-102501-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.101050 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved