import win32gui import win32api import pyautogui # from pymouse import PyMouse hwnd_title = {} def get_all_hwnd(hwnd, mouse): if (win32gui.IsWindow(hwnd) and win32gui.IsWindowEnabled(hwnd) and win32gui.IsWindowVisible(hwnd)): hwnd_title.update({hwnd: win32gui.GetWindowText(hwnd)}) win32gui.EnumWindows(get_all_hwnd, 0) # m = PyMouse() for h, t in hwnd_title.items(): if t : print(h, t) if t == '米格尔': left, top, right, bottom = win32gui.GetWindowRect(h) print(left,top,right,bottom) pyautogui.click(right-206,bottom-31)
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。