gpt4 book ai didi

python - 使用pywinauto点击对话框取消按钮

转载 作者:可可西里 更新时间:2023-11-01 11:43:57 40 4
gpt4 key购买 nike

我遇到过这样一种情况,如果将受密码保护的 .ppt 文件传递​​给 PowerPoint 的自动化进程,它就会挂起。我已经使用 pywinauto 编写了一个脚本来检测何时发生这种情况并连接到“密码”对话框,但我似乎无法让它单击“取消”按钮。

这是我在“输入密码”对话框中看到的控件标识符:

NUIDialog - 'Password'    (L649, T422, R999, B553)
['NUIDialog', 'Password', 'PasswordNUIDialog']
child_window(title="Password", class_name="NUIDialog")
|
| NetUIHWND - '' (L657, T453, R991, B545)
| ['NetUIHWND', 'PasswordNetUIHWND']
| child_window(class_name="NetUIHWND")
| |
| | NetUICtrlNotifySink - '' (L728, T495, R983, B510)
| | ['PasswordNetUICtrlNotifySink', 'NetUICtrlNotifySink']
| | child_window(class_name="NetUICtrlNotifySink")
| | |
| | | RICHEDIT60W - '' (L728, T495, R983, B510)
| | | ['PasswordRICHEDIT60W', 'RICHEDIT60W']
| | | child_window(class_name="RICHEDIT60W")
| |
| | RICHEDIT60W - '' (L728, T495, R983, B510)
| | ['PasswordRICHEDIT60W', 'RICHEDIT60W']
| | child_window(class_name="RICHEDIT60W")
|
| NetUICtrlNotifySink - '' (L728, T495, R983, B510)
| ['PasswordNetUICtrlNotifySink', 'NetUICtrlNotifySink']
| child_window(class_name="NetUICtrlNotifySink")
| |
| | RICHEDIT60W - '' (L728, T495, R983, B510)
| | ['PasswordRICHEDIT60W', 'RICHEDIT60W']
| | child_window(class_name="RICHEDIT60W")
|
| RICHEDIT60W - '' (L728, T495, R983, B510)
| ['PasswordRICHEDIT60W', 'RICHEDIT60W']
| child_window(class_name="RICHEDIT60W")

我尝试执行 password_dialog.NetUICtrlNotifySink.Click() 但没有任何反应。有什么想法吗?

最佳答案

我建议对所有 MS Office 产品使用 Application(backend="uia")。它应该会看到更多控件。

关于python - 使用pywinauto点击对话框取消按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50956800/

40 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com