_poll: qq找窗去子线程,纯Win32直接跑在_run_loop线程

This commit is contained in:
youpaishidifu
2026-07-27 19:27:22 +08:00
parent e723ce582e
commit 17bfe35520
+6 -2
View File
@@ -1998,8 +1998,12 @@ class MessageMonitor:
counter = self._poll_count.get(platform, 0) + 1
self._poll_count[platform] = counter
# 1. 确保窗口句柄(带超时保护,防止 UIA COM 调用挂死不返回)
hwnd = self._ensure_hwnd_with_timeout(platform, timeout=12.0)
# 1. 确保窗口句柄
# qq 路径纯 Win32+psutil,直接调用不超时;wechat 用 UIA(可能挂死)才套子线程
if platform == "qq":
hwnd = self._ensure_hwnd(platform)
else:
hwnd = self._ensure_hwnd_with_timeout(platform, timeout=12.0)
if not hwnd:
if counter % 10 == 0 or (counter == 1 and platform == "qq"):
logger.debug(f"[{platform}] 窗口未找到")