staples Posted October 9, 2007 Share Posted October 9, 2007 I want to find the pixel location (since it can vary) and mouse over it to remove my icon that remains after I kill a task. Does anyone know how to find the location of windows xp system tray? Is there another way to refresh the system tray? Link to comment Share on other sites More sharing options...
Blue_Drache Posted October 9, 2007 Share Posted October 9, 2007 Generally the tray can be in one of four locations, dependant on what side of the monitor the tray's been docked on. Why not just wave the mouse over these four areas in sequence? Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
weaponx Posted October 9, 2007 Share Posted October 9, 2007 (edited) This brute force method seems to work: Func RefreshTray() $speed = 5 $original = MouseGetPos() MouseMove (10,10) MouseMove (10,@DesktopHeight - 10, $speed) MouseMove (@DesktopWidth - 10,@DesktopHeight - 10, $speed) MouseMove (@DesktopWidth - 10,10, $speed) MouseMove (10,10, $speed) MouseMove ($original[0],$original[1]) EndFunc Edited October 9, 2007 by weaponx Link to comment Share on other sites More sharing options...
staples Posted October 10, 2007 Author Share Posted October 10, 2007 That works. I added some speed to it. RefreshTray() Func RefreshTray() $speed = 2 $original = MouseGetPos() MouseMove(10,10,$speed) MouseMove(10,@DesktopHeight - 10, $speed) MouseMove(@DesktopWidth - 10,@DesktopHeight - 10, $speed) MouseMove(@DesktopWidth - 10,10, $speed) MouseMove(10,10, $speed) MouseMove($original[0],$original[1],$speed) EndFunc Link to comment Share on other sites More sharing options...
weaponx Posted October 10, 2007 Share Posted October 10, 2007 When I made the speed any faster, some icons that needed to disappear stayed behind. But varying resolutions could effect this. Link to comment Share on other sites More sharing options...
ssubirias3 Posted October 12, 2007 Share Posted October 12, 2007 (edited) Generally the tray can be in one of four locations....Beyond what Blue_Drache and weaponx have offered, this does what you were asking / looking for. I put this together after not being able to find a registry key that provided the taskbar location. Hope this helps you and others out. Opt("WinTitleMatchMode", 4) $aTray = WinGetPos("[Class:Shell_TrayWnd]") If ($aTray[0] == 0) And ($aTray[2] == @DesktopWidth) Then If ($aTray[1] == 0) Then MsgBox(0, "", "Taskbar is on Top") Else MsgBox(0, "", "Taskbar is on Bottom") EndIf EndIf If ($aTray[1] == 0) And ($aTray[3] == @DesktopHeight) Then If ($aTray[0] == 0) Then MsgBox(0, "", "Taskbar is to the Left") Else MsgBox(0, "", "Taskbar is to the Right") EndIf EndIf On a related note, anyone know how to get the coord of a particular icon in the systray without using PixelSearch()? Thanks in advance! ======== Edit: After a little more searching I found this UDF that give me what I was after. Others looking for scripts that control the systray should look at this link for Systray UDF. Edited October 12, 2007 by ssubirias3 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now