【发布时间】:2023-02-10 12:34:39
【问题描述】:
我的任务栏:- enter image description here
单击箭头后的任务栏:-
想做的是,在任务栏中右击某个应用程序后,是否可以再点击更多选项?
到目前为止我的代码:-
from pywinauto import taskbar
taskbar.TaskBar.Button.click_input()
popup_dlg = taskbar.explorer_app.window(class_name='NotifyIconOverflowWindow')
popup_toolbar = popup_dlg.Overflow_Notification_Area
print(popup_toolbar.texts()[1:])
popup_toolbar.button('Honeygain').click_input(button='right')
红色图标是我要在任务栏中打开的应用程序。 红色图标的名称是“用户配置文件尚未准备好听写”。 在我的代码中,我写了右键单击红色图标。 但是会出现更多的选项。
之后,我想点击工具 然后,我想点击转录录音。
控制标识符:-
Toolbar - 'Overflow Notification Area' (L1416, T835, R1556, B975)
['Overflow Notification Area', 'Overflow Notification AreaToolbar', 'Toolbar']
child_window(title="Overflow Notification Area", class_name="ToolbarWindow32")
【问题讨论】:
-
你在Windows 7上吗?你也可以添加弹出菜单的
dump_tree()吗? -
首先,我在 Windows 11 上。你能详细说明什么是转储树吗?
-
dump_tree() 是打印应用程序控件标识符的东西。就像 webelements 的 html 标签一样。或者您必须使用
print_identifiers()而不是dump_tree() -
我更新了问题。请参阅问题中的 Control_Identifiers
标签: python user-interface automation taskbar pywinauto