Is it possible to get the position of the systemTray icon of an application?

Mar 17, 2010 at 10:06 AM

Hi all,

i have an application that has no (real/open) window but a system tray icon. To close this application i need to rightClick this icon and select an Item from the popup menu. My problem now is how to right-click the icon? Is it possible to retrieve the icon in the system tray?



Mar 17, 2010 at 11:04 AM
Edited Mar 17, 2010 at 11:08 AM

have you try UISpy or UIAVerify,


as you use it you can see the complete Structure to a system tray Icon:


ControlType Pane with name="" and Uid=""

  ContoleType Pane with no name and Uid="303" (Tray and Clock)

  this contains the tray part as ControlType Pane with name ="" and UId=""

 contains ControlType.ToolBar with a name="not empty" and UId="1504"

  and here you can find Buttons for each application






=> this will get the ToolBar and here you should search for the button


if you can't find such way maybe try

AutomationElement element = Desktop.Instance.GetElement(SearchCriteria.ByAutomationId("1504"));

ToolStrip toolBar = new ToolBar(element, Desktop.Instance.ActionListener);


or try to get the completet element path step by step