-
Notifications
You must be signed in to change notification settings - Fork 72
/
Copy pathTrayRefresh.ahk
52 lines (52 loc) · 1.29 KB
/
TrayRefresh.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
Tray_Refresh() {
/* Refreshes the Tray Icons, to remove any "leftovers"
* Should work both for Windows 7 and 10
*/
WM_MOUSEMOVE := 0x200
HiddenWindows := A_DetectHiddenWindows
DetectHiddenWindows, On
TrayTitle := "AHK_class Shell_TrayWnd"
ControlNN := "ToolbarWindow322"
IcSz := 24
Loop, 8
{
index := A_Index
if ( index = 1 || index = 3 || index = 5 || index = 7 ) {
IcSz := 24
}
else if ( index = 2 || index = 4 || index = 6 || index = 8 ) {
IcSz := 32
}
if ( index = 1 || index = 2 ) {
TrayTitle := "AHK_class Shell_TrayWnd"
ControlNN := "ToolbarWindow322"
}
else if ( index = 3 || index = 4 ) {
TrayTitle := "AHK_class NotifyIconOverflowWindow"
ControlNN := "ToolbarWindow321"
}
if ( index = 5 || index = 6 ) {
TrayTitle := "AHK_class Shell_TrayWnd"
ControlNN := "ToolbarWindow321"
}
else if ( index = 7 || index = 8 ) {
TrayTitle := "AHK_class NotifyIconOverflowWindow"
ControlNN := "ToolbarWindow322"
}
ControlGetPos, xTray,yTray,wdTray,htTray, %ControlNN%, %TrayTitle%
y := htTray - 10
While (y > 0)
{
x := wdTray - IcSz/2
While (x > 0)
{
point := (y << 16) + x
PostMessage, %WM_MOUSEMOVE%, 0, %point%, %ControlNN%, %TrayTitle%
x -= IcSz/2
}
y -= IcSz/2
}
}
DetectHiddenWindows, %HiddenWindows%
Return
}