我想使用 pywinauto 自动执行以下步骤
1) 打开 Windows 资源管理器 2) 右键单击文件 3)列出右键单击文件时弹出的上下文菜单中的所有项目/选项。
在pywinauto中可以吗?
如果没有可以在AutoIt中完成吗?
我在这个论坛上找到了解决方案。检查最后一个代码,其中包含在上下文菜单中列出项目的代码。 http://www.autoitscript.com/forum/topic/160519-click-on-item-of-a-standard-context-menu/
我还找到了一种使用 pywinauto 获取它的方法。
我使用辅助功能洞察工具来获取整个上下文菜单窗格的“名称”属性。 就我而言,它是“上下文菜单”。这将成为要放入下面代码中的“标题”:
#below code is the context of variable "dlg"
app = Application(backend = "uia").start("Your_app_path.exe")
dlg = app.Dialog
dlg.child_window(title="Context Menu").print_control_identifiers()