Jump to content

SystemTray_Refresh


rasim
 Share

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)

:)

Link to comment
Share on other sites

  • 2 months later...

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...