如何获取本机当前登陆的QQ号码
如何获取本机当前登陆的QQ号码Private Function GetQQ() As String
Dim i As Long
Dim cls As Long
Dim hWin As Long
Dim szTmp As String
Dim l As Long
cls = &H61A00000
For i = 0 To 17
cls = cls + &H10000
Do
hWin = FindWindowEx(0, hWin, "Afx:" & Hex(cls) & ":2", vbNullString) 'ws的qq,用版本号当做类名。。。
szTmp = String(260, vbNullChar)
Call GetWindowText(hWin, szTmp, 260)
szTmp = Left$(szTmp, GetWindowTextLength(hWin))
l = InStr(szTmp, "_QQMusic_SmallClient")
If l > 0 Then
GetQQ = Left$(szTmp, l - 1)
Exit Function
End If
If hWin = 0 Then Exit Do
Loop
Next
End Function
为什么得到的是“”空值