I'm trying to write a test to right-click on an icon in the Windows notification tray and then identify a context menu item by text and left-click on that.
What I have so far looks something like:
Code: Select all
hTaskTray = r.FormFindClassName("Shell_TrayWnd", 1, TRUE, TIMEOUT)
hNotifyTray = r.FormFindChildClassName(hTaskTray, "TrayNotifyWnd", 1)
hNotifyArea = r.FormFindChildClassName(hNotifyTray, "ToolbarWindow32", 1)
# Print the number of notification area icons
print r.ToolStripGetItemCount(hNotifyArea)
# Select Windows volume control icon and select the second item on
# its menu
print r.ToolStripSelectPosition(hNotifyArea, 1, 2) # CRASHES PythonWin
Cheers.