Created
November 14, 2021 16:30
-
-
Save anonymous1184/678fc86eda927af072a7d9656b5d49f0 to your computer and use it in GitHub Desktop.
Remove dead icons from tray
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Version: 2021.11.14.1 | |
TrayRefresh() | |
{ | |
dhw := A_DetectHiddenWindows | |
DetectHiddenWindows On | |
TrayRefresh_Clear("Shell_TrayWnd", 323) | |
; For hidden icons: | |
; TrayRefresh_Clear("NotifyIconOverflowWindow", 321) | |
DetectHiddenWindows % dhw | |
} | |
TrayRefresh_Clear(WinClass, ControlNN) | |
{ | |
WinClass := "ahk_class" WinClass | |
ControlNN := "ToolbarWindow" ControlNN | |
iconSize := 16 | |
WinExist(WinClass) | |
ControlGetPos ,,, w, h, % ControlNN | |
while (h > 0) | |
{ | |
while (w > 0) | |
{ | |
point := (h << 16) + w | |
; 0x0200 = WM_MOUSEMOVE | |
PostMessage 0x0200, 0, % point, % ControlNN | |
w -= iconSize | |
} | |
h -= iconSize | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment