Sign in to follow this  
Followers 0
rasim

SystemTray_Refresh

5 posts in this topic

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



Valik did something similar here: http://www.autoitscript.com/forum/index.ph...ic=7404&hl= a while ago.


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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

@rasim,

This little script did the trick for me and reliably removed my left over icons.

Thanks!

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  
Followers 0