我从 pip 安装了最后一个 pywinauto 模块。
我不知道如何使用 Check()、UnCheck()、GetCheckState() 方法。
这是我非常简单的代码示例。
from pywinauto import application
# Start the madvr settings application.
app = application.Application()
app.start_(r'C:\Program Files\LAV Filters\x86\madVR\madHcCtrl.exe editLocalSettingsDontWait')
# Handle the madvr settings window.
madvr = app.window_(title_re="madVR.*")
# Enable the smooth motion tab.
madvr.TreeView.GetItem(r'\rendering\smooth motion').Click()
# Check the smooth motion checkbox.
madvr.TCheckBox.Check()
如果我使用 Click() 方法,它会起作用,但这不是我想要的。
madvr.TCheckBox.Click()
如果该复选框已被选中,则会取消选中它。
为什么我不能使用 Check() 方法?
我尝试使用 Uncheck() 和 GetCheckState() 方法,它们也不起作用。
我已经添加"TCheckBox"
类名以在 0.5.1 中进行正确的复选框检测(将于本周发布)。感谢您的用例。目前您可以解决这个问题(代码已更新为 pywinauto==0.6.x):
from pywinauto.controls.win32_controls import ButtonWrapper
checkbox = ButtonWrapper(madvr.TCheckBox.wrapper_object())
checkbox.get_check_state()
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)