11-19-2012, 08:18 AM
@Ankesh,
It is simply,
1. I wanna get the list of running program icon on SystemTray.
2. Get the position.
3. Click on it.
NOTE: The problem only happens on Win7 (my current working station is 64Bit)
Here is my sorted code:
It is simply,
1. I wanna get the list of running program icon on SystemTray.
2. Get the position.
3. Click on it.
NOTE: The problem only happens on Win7 (my current working station is 64Bit)
Here is my sorted code:
Code:
nItems = Window(objWindow).WinToolbar(Notification Area).GetItemsCount
For nItem = 1 To nItems
'Get Name
sItemName = Window(objWindow).WinToolbar(Notification Area).GetItem(nItem)
If sItemName = strAppName Then ' if the name is required Application
x = Window(objWindow).WinToolbar(Notification Area).GetROProperty("abs_x")
y = Window(objWindow).WinToolbar(Notification Area).GetROProperty("abs_y")
objWidth = Window(objWindow).WinToolbar(Notification Area).GetROProperty("width")
ApproxIconWidth = objWidth / nItems '' ApproxIconWidth = TotalWidth / Total items count
objX =(ApproxIconWidth * nItem - 1) ''Formula used - ApproxIconWidth * ItemNumber - Gutter (i.e. space between two icons - Let gutter = 1)
Window(objWindow).WinToolbar(Notification Area).DblClick objX,2,micLeftBtn 'Double left click on icon
End If
Next