admin
2024-12-16 ec012b7d2b915db24cd8b23f723bf18dfe75b7d6
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])