求怎么判断当前登录的QQ号(新版QQ)
以下VB.NET代码之前支持QQNT版本, 前几天QQ更新QQ9版本后获取不到了,哪位表哥有空帮忙优化改善一下,谢谢Imports System.Runtime.InteropServices
Imports System.Text
Imports System.Text.RegularExpressions
Imports System.Windows.Forms
Public Class Class1
<DllImport("user32.dll", CharSet:=CharSet.Auto, SetLastError:=True)>
Public Shared Function GetClassName(hWnd As IntPtr, lpClassName As StringBuilder, nMaxCount As Integer) As Integer
End Function
<DllImport("user32.dll")>
Private Shared Function IsWindowVisible(hWnd As IntPtr) As Boolean
End Function
<DllImport("user32.dll")>
Private Shared Function IsWindow(hWnd As IntPtr) As Boolean
End Function
Public Shared Function FindAndProcessWindows() As List(Of String)
Dim result As New List(Of String)()
Dim hWnd As IntPtr
Dim className As New StringBuilder(64)
Dim qqclassName As String
For i As Integer = 65535 To 42000000
hWnd = CType(i, IntPtr)
If IsWindow(hWnd) AndAlso Not IsWindowVisible(hWnd) Then
className.Length = 0
If GetClassName(hWnd, className, className.Capacity) <> 0 Then
qqclassName = className.ToString()
If qqclassName.StartsWith("NTQQOpenSdk") OrElse qqclassName.StartsWith("OPENSDK_SHARE2QQ_QQ_WINCLASS") Then
Dim match = Regex.Match(qqclassName, "_(\d+)$")
If match.Success Then
Dim result1 As String = match.Groups(1).Value
result.Add(result1)
End If
End If
End If
End If
Next
Return result
End Function
End Class
纯支持,专业的东西真不会 qqnt还能防撤回吗? 本帖最后由 chr233 于 2024-9-23 09:42 编辑
怪盗基德 发表于 2024-9-22 15:46
qqnt还能防撤回吗?
可以的https://s21.ax1x.com/2024/09/23/pAMjjoD.png
chr233 发表于 2024-9-23 09:36
可以的
求教在哪里下载,更新
页:
[1]