From ec012b7d2b915db24cd8b23f723bf18dfe75b7d6 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期一, 16 十二月 2024 11:13:31 +0800
Subject: [PATCH] 网页代码修改/结构调整

---
 utils/ths_util.py |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/utils/ths_util.py b/utils/ths_util.py
index 7b6c545..4fa8c5b 100644
--- a/utils/ths_util.py
+++ b/utils/ths_util.py
@@ -79,6 +79,23 @@
     return None
 
 
+__cache_hwnd = {}
+
+
+def get_ths_main_content_hwnd_cached():
+    """
+    鑾峰彇鍚岃姳椤轰富椤靛彞鏌�
+    :return:
+    """
+    target_hwnd = __cache_hwnd.get("ths_main_content_hwnd")
+    if target_hwnd and win32_util.is_visible(target_hwnd):
+        return target_hwnd
+    target_hwnd = get_ths_main_content_hwnd()
+    if target_hwnd:
+        __cache_hwnd["ths_main_content_hwnd"] = target_hwnd
+    return target_hwnd
+
+
 # 鎵归噺鐐瑰嚮浜嬩欢
 def betch_click(hwnd, ps, space_time=0.5):
     for p in ps:
@@ -121,7 +138,7 @@
         origin_hwnd = hwnds[0]
         for w in hwnds:
             title = win32_util.getText(w)
-            if title.find("鍚岃姳椤�")>=0:
+            if title.find("鍚岃姳椤�") >= 0:
                 origin_hwnd = w
                 break
         input_code(origin_hwnd, num_str[:1])

--
Gitblit v1.8.0