Python pyautogui 窗口句柄 [英] Python pyautogui window handle

查看:68
本文介绍了Python pyautogui 窗口句柄的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 pyautogui 有没有办法获得窗口的句柄,以便我可以确保仅在该窗口上执行单击?换句话说,如果我的窗口不在焦点上,则不会发生单击.此外,如果我的窗口没有聚焦,那么我会将其聚焦,然后执行操作.

识别窗口的方式可以是 ID、窗口标题等,类似于

Using pyautogui is there a way to get a handle to a window so that I can ensure that a click is performed on that window only? In other words, if my window isn't in focus, then the click does not occur. Additionally, if my window isn't in focus then I bring it into focus and then perform the actions.

The way to identify a window could be an ID, window title etc similar to this https://autohotkey.com/docs/commands/WinGet.htm

Is there any other Python module that supports this kind of functionality?

解决方案

Is there any other Python module that supports this kind of functionality?

https://github.com/pywinauto/pywinauto

https://pywinauto.readthedocs.io/en/latest/#some-similar-tools-for-comparison

这篇关于Python pyautogui 窗口句柄的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆