_poll: qq找窗去子线程,纯Win32直接跑在_run_loop线程
This commit is contained in:
+5
-1
@@ -1998,7 +1998,11 @@ class MessageMonitor:
|
|||||||
counter = self._poll_count.get(platform, 0) + 1
|
counter = self._poll_count.get(platform, 0) + 1
|
||||||
self._poll_count[platform] = counter
|
self._poll_count[platform] = counter
|
||||||
|
|
||||||
# 1. 确保窗口句柄(带超时保护,防止 UIA COM 调用挂死不返回)
|
# 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)
|
hwnd = self._ensure_hwnd_with_timeout(platform, timeout=12.0)
|
||||||
if not hwnd:
|
if not hwnd:
|
||||||
if counter % 10 == 0 or (counter == 1 and platform == "qq"):
|
if counter % 10 == 0 or (counter == 1 and platform == "qq"):
|
||||||
|
|||||||
Reference in New Issue
Block a user