Jump to content
Sign in to follow this  
rasim

SystemTray_Refresh

Recommended Posts

Hi!

Very often i see messages e.g. "I kill program from task manager, but icon of this program still showed in system tray. How can clear taskbar from icons of killed app.`s?" And i have written this script:

#include <WinAPI.au3>

$hTaskBar = _WinAPI_FindWindow("Shell_TrayWnd", "")
$hParent  = ControlGetHandle($hTaskBar, "", "TrayNotifyWnd1")
$hWnd     = ControlGetHandle($hParent, "", "ToolbarWindow321")

$WinRect  = _WinAPI_GetWindowRect($hWnd)

$aMousePos = MouseGetPos()

$Left  = DllStructGetData($WinRect, "Left")
$Right = DllStructGetData($WinRect, "Right")
$Top   = DllStructGetData($WinRect, "Top")

For $i = $Left To $Right
    MouseMove($i, $Top, 0)
Next

MouseMove($aMousePos[0], $aMousePos[1], 0)

:)

Share this post


Link to post
Share on other sites

I haven't tried the script yet, but does it move the cursor towards the 'dead' icon, to clear the icon?

Yes :)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...