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)
Python 获取窗口句柄,模拟鼠标点击
- THE END -
本文由 @晓说杂谈 修订发布于 2023-07-30
本文来自投稿,不代表本站立场,如若转载,请注明出处:https://www.wxx86.cn/program/1227.html