header1   header
header
header Register : : Login header
header
connector   connector
menuleft menuright
submenu   submenu
left
Accessing Systray Items Found Using UI Spy
Last Post 05 May 2010 11:06 AM by snowlark. 0 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
snowlarkUser is Offline
New Member
New Member
Posts:7
Avatar

--
05 May 2010 11:06 AM
    Alright, I really have been searching on both the net and here within the forums. I am trying to access all the objects in the systray to then RIGHT-CLICK the target object which will promote the app-menu allowing me to choose one of the commands within the menu. I have seen the "Reset-Tray" code, and am using quite a bit of it (thanks, Joel!), but am trying to drill down further to get the NextChild and Siblings I see within UI Spy ... no luck so far ... grrrrr ...

    Here's the code I have so far:
    function List-MySystrayItems{ Add-Type -Assembly UIAutomationClient # The goal is to isolate the two areas in the systray: notification area # and system control area # $loadedSet = [System.Windows.Automation.AutomationElement]::RootElement.FindAll( "Descendants" , [System.Windows.Automation.Condition]::TrueCondition ) | Where { $_.GetCurrentPropertyValue([System.Windows.Automation.AutomationElement]::ClassNameProperty) -like "SysPager" } | ForEach { $_.FindAll( "Children" , [System.Windows.Automation.Condition]::TrueCondition ) } | Where { $_.GetCurrentPropertyValue([System.Windows.Automation.AutomationElement]::NameProperty) -like "*Notif*" } # just show how many items were found - if more than one, problem # Write-Output "Getting set info: '$loadedSet'" # Begin to drill down into the NextChild items and list the Siblings # $setName = $loadedSet.GetCurrentPropertyValue([System.Windows.Automation.AutomationElement]::NameProperty) Write-Output "setName: '$setName'" $indItem0 = $loadedSet.FindAll( "Subtree" , [System.Windows.Automation.Condition]::TrueCondition ) Write-Output "indItem0: '$indItem0'" }

    I get the last element, there in variable '$indItem0' which then I believe contains the items I need. I am not able to get the list, however, using the code I know - and have found.

    I am going to keep hammering away, but any help I can get that will make this faster, I would greatly appreciate it!

    --steve
    You are not authorized to post a reply.


    Active Forums 4.3
    right
    footer   footer
    footer Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2 footer
    footer   footer