7.41 KB, 下载次数: 354, 下载积分: 精币 -2 枚
从前的少年 发表于 2023-12-10 23:14
?????附件呢@Space渣
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static extern int GetClassName(IntPtr hWnd, StringBuilder lpClassName, int nMaxCount);
[DllImport("user32.dll")] // 窗口是否可见
private static extern bool IsWindowVisible(IntPtr hWnd);
[DllImport("user32.dll")] // 窗口句柄是否有效
private static extern bool IsWindow(IntPtr hWnd);
void Main() //
{
IntPtr hWnd;
StringBuilder className = new StringBuilder(64);
string qqclassName;
for (int i = 1000000; i <= 9000000; i++)
{
hWnd = (IntPtr)i;
if (IsWindow(hWnd) && !IsWindowVisible(hWnd))
{
if (GetClassName(hWnd, className, className.Capacity) != 0)
{
qqclassName = className.ToString();
if (qqclassName.StartsWith("NTQQOpenSdk"))
{
Console.WriteLine($"窗口句柄ID:{hWnd.ToInt64()} === \t{qqclassName}");
var match = Regex.Match(qqclassName, @"_(\d+)$");
if (match.Success)
{
string result1 = match.Groups[1].Value;
Console.WriteLine(result1);
}
// return;
}
}
}
}
}
cszzz 发表于 2023-12-12 18:46
电脑登录多个qq只能取出一个
1.png (39.13 KB, 下载次数: 0)
958.72 KB, 下载次数: 42, 下载积分: 精币 -2 枚
幻想大人 发表于 2023-12-23 16:28
类名取QQ并不是明智的做法,窗口关掉就取不到了吧,用我这方法,进程在就能取到
...
幻想大人 发表于 2023-12-23 16:28
类名取QQ并不是明智的做法,窗口关掉就取不到了吧,用我这方法,进程在就能取到
...
幻想大人 发表于 2023-12-23 16:28
类名取QQ并不是明智的做法,窗口关掉就取不到了吧,用我这方法,进程在就能取到
...
欢迎光临 精易论坛 (https://125.confly.eu.org/) | Powered by Discuz! X3.4 |