Using PyWinAuto (or anything else) to interact with hidden icons on the taskbar

ⅰ亾dé卋堺 提交于 2019-12-05 16:23:54

Install latest version of pywinauto on 64-bit Python (2.7 or 3.4, it doesn't matter) and run the following code:

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:])

Further you can press interested button based on retrieved texts:

popup_toolbar.button('your program name').click_input(double=True)

EDIT (2019, January): this code may not work for latest Windows 10 RS1+ because notification icons area was changed significantly, though it should work for Win7 and Win8.1.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!