How to send right-click to tray application

Sep 12, 2012 at 8:37 AM

I was wondering if it is possible to find all tray applications and then send a right-click to open the popup menu.

Sep 12, 2012 at 5:23 PM

Short answer: yes. 

I'm not on Windows right this second, so I'll get back on here later and post how if nobody beats me to it.

Sep 24, 2012 at 5:42 AM
Edited Sep 24, 2012 at 5:42 AM
Import-Module WASP

## Starting from the tray container, 
Select-UIElement -Class Shell_TrayWnd | 
    ## Pick the real system tray Window 
    Select-UIElement -Class TrayNotifyWnd | 
    ## It has a the Notification Chevron expander button
    ## It also has the "SysPager" which has the icons in it (FYI)
    ## Pick the button and click it:
    Select-UIElement -Name "Notification Chevron" | Invoke-Invoke.Invoke

## Now start from the Overflow window 
Select-UIElement -Name "Notification Overflow" | 
    ## Then find the icon container:
    Select-UIElement -Name "Overflow Notification Area" | 
    ## Pick an icon (in this case, the SkyDrive icon) and click it:
    Select-UIElement -Name "SkyDrive*" | Invoke-Invoke.Invoke


That's using the new script module instead of the binary. I'll try to release that version here this week.