Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) 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 GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
Private Const GW_CHILD = 5
Private Const GW_HWNDNEXT = 2
Private Sub Command1_Click()
Dim hWin As Long
Dim strText As String
Dim strClass As String
Dim arr(1 To 5) As String
Dim flag As Integer
Dim length As Integer
flag = 1
List1.Clear
'第一个QQ消息窗口
hWin = FindWindow("CTXOPConntion_Class", vbNullString)
If hWin = 0 Then Exit Sub
Do
strText = String$(50, vbNullChar)
GetWindowText hWin, strText, Len(strText)
strText = Left$(strText, InStr(strText, vbNullChar) - 1)
If InStr(strText, "OP_") = 1 Then
strText = Mid$(strText, 4)
List1.AddItem strText
arr(flag) = strText
flag = flag + 1
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余1页未读,立即下载