/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * Disclaimer: I do not foresee any risk in running this script but you may run this file "ONLY" at your own risk. * * * * * * * * * * * * * * * * * * * * * * * * * * * * File Name : Refresh_TrayNotificationArea.ahk Download : http://file.autohotkey.net/goyyah/Tips-N-Tricks/TaskBar/Refresh_TrayNotificationArea.ahk Post : http://www.autohotkey.com/forum/viewtopic.php?p=55641#55641 Main Title : Taskbar Utility Sub Title : Tray Notification Area Refresher. Description : Icons are not removed from TNA (Tray Notification Area) automatically when an Application is killed from AHK script. To refresh TNA from a script, A tactical Mouse manoeuvre over the TNA is required to refresh it thereby removing the undesired Icon. This script simulates zigzag movement of mouse cursor exactly over TNA, irrespective of the size & position of the Taskbar. Note : This script should work fine with standard settings. However, I have set the Variable "MouseMovementSpeed" with a 20 to be slow (for demonstration purpose). Change "MouseMovementSpeed" to 2 Ideal values for "VerticalOffset" : 8 for "Horizontal Taskbar" 16 for "Vertical Taskbar" Author : A.N.Suresh Kumar aka "Goyyah" Email : arian.suresh@gmail.com Created : 2006-04-05 Modified : 2006-04-05 Scripted in : AutoHotkey Version 1.0.43.02 , www.autohotkey.com */ MouseMovementSpeed=20 ; Change value to 2 VerticalOffset=4 ; Change value to 8 - 16 CoordMode,Mouse,Screen MouseGetPos,PosX,PosY CoordMode,Mouse,Relative WinGet,Tray_ID,ID,ahk_class Shell_TrayWnd ; Get the size for "Tray Notification Area" - Activate it - Move Mouse to Top-Left ControlGetPos, X1, Y1, cWidth, cHeight, TrayNotifyWnd1, ahk_id %Tray_ID% X2 := X1+cWidth Y2 := Y1+cHeight WinActivate, ahk_id %Tray_ID% MouseMove,%X1%,%Y1%,0 X:=X1 Y:=Y1 Loop ; performs the Zigzag movement of Mouser Cursor. { Y= % Y+VerticalOffset if Y > %Y2% Break WinActivate, ahk_id %Tray_ID% MouseMove, % X, % Y, % MouseMovementSpeed ControlGetPos, X1, Y1, cWidth, cHeight, TrayNotifyWnd1, ahk_id %Tray_ID% X2 := X1+cWidth Y2 := Y1+cHeight If X= %X1% X= %X2% else X= %X1% } CoordMode,Mouse,Screen MouseMove,%PosX%,%PosY%,0 Return