MarioX Posted December 6, 2005 Share Posted December 6, 2005 (edited) I see often that the attempt to ProcessClose a process with a tray icon kill the task but leave the icon visible, you need to over the icon with mouse cursor to allow disappear it. There is a way to "refresh" the system tray icons after killing a process ? Edited December 6, 2005 by MarioX Link to comment Share on other sites More sharing options...
TK_Incorperate Posted December 6, 2005 Share Posted December 6, 2005 as far as i know, moving your mouse over the icon in the tray is the only way.... but i'm not really skilled at this stuff so you should probably take a second opinion Link to comment Share on other sites More sharing options...
trids Posted December 6, 2005 Share Posted December 6, 2005 Have you tried doing a MouseMove() over the system tray to refresh it? Link to comment Share on other sites More sharing options...
MarioX Posted December 6, 2005 Author Share Posted December 6, 2005 Have you tried doing a MouseMove() over the system tray to refresh it? Thanks all for the help. The trids idea sound interesting, but since I'm a really beginner user I'm interested in getting some help about the needed code...It's probably necessary to know the lenght of the tray icons area and it's height. Link to comment Share on other sites More sharing options...
BigDod Posted December 6, 2005 Share Posted December 6, 2005 (edited) Thanks all for the help. The trids idea sound interesting, but since I'm a really beginner user I'm interested in getting some help about the needed code...It's probably necessary to know the lenght of the tray icons area and it's height.There is a UDF called Systray_UDF by Taupe that can be used to find the position of the system tray icon. You can then use mousemove to move the mouse to the correct place. Do a search in Scripts and Scraps for Systray_UDF and you will find it.EditHere it is Edited December 6, 2005 by BigDod Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
VeeDub Posted December 6, 2005 Share Posted December 6, 2005 Hi Mario,A clever person (not me!) wrote this function to refresh the system trayhttp://www.autoitscript.com/forum/index.ph...wtopic=7404&hl=Cheers,VW Link to comment Share on other sites More sharing options...
MarioX Posted December 6, 2005 Author Share Posted December 6, 2005 (edited) The Systray UDF could be very handy.The VeeDub suggested thread it's what I need.Also this thread talk about dead icon cleanup:http://www.autoitscript.com/forum/index.php?showtopic=18052Thanks all! Edited December 6, 2005 by MarioX Link to comment Share on other sites More sharing options...
VeeDub Posted December 7, 2005 Share Posted December 7, 2005 Hi Mario,The code in the link that I posted wouldn't work for me on a W2K system. It ran, but it didn't refresh the system tray icons.So I had a look at the other code in the other link that you posted: http://www.autoitscript.com/forum/index.php?showtopic=18052That code wasn't working for me either, but I found this snippet much easier to understand. What was happening was that the mouse was moving along the bottom of the SystemTray rather than across the middle (and over the icons). So I made a few modifications to that script which has worked for me, and might perhaps work for you.Func RefreshSystemTray() Local $CurrentPos = MouseGetPos() AutoItSetOption("WinTitleMatchMode", 4) Local $Tray = WinGetClientSize("classname=Shell_TrayWnd", "") if not @error then Local $MiddleofSysTray = @DesktopHeight - int($Tray[1]/2) for $i = 5 to $Tray[0] - 5 Step 5 MouseMove($i, $MiddleofSysTray, 1) Next MouseMove($CurrentPos[0], $CurrentPos[1], 1) EndIf EndFuncI should note that my logic is based on MikeOsdx's original script, without which I would not have been able to figure this out. The above code doesn't need the beta to run.One other point, moving the mouse pointer across the middle of the System Tray (actually the whole bottom of the desktop) is noticeable when it happens. This isn't a problem for me, as the script I am using this code in runs late at night when nobody is watching the desktop - and I just want to refresh the system tray icons. I suspect that MikeOsdx pushed the mouse pointer lower to make it more discreet, trouble is that I think he went a little to close to the bottom of the screen. Anyway if you want the movement of the mouse across the SystemTray to be as discreet as possible, you may have to experiment with different values for $MiddleofSysTray (i.e. effectively change the Y-axis mouse position value to $BottomofSysTray).Hope it helps.Cheers,VW Link to comment Share on other sites More sharing options...
Valik Posted December 8, 2005 Share Posted December 8, 2005 If you want it as discreet as possible, you need to be using my function. MouseMove() is extremely slow (Comparatively speaking). My function covers every pixel in the tray in a fraction of the time it takes MouseMove() to do one row. Link to comment Share on other sites More sharing options...
MarioX Posted December 8, 2005 Author Share Posted December 8, 2005 I've tested the Valik function and it work absolutely fine. It's also "smart" because did not interfere with Gui's desktop mouse etc. I will later test the VeeDub tweaked function. I also confirm that the original function fail to clean dead icons on my system. A BIG thanks to all of you for the support! 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