Hook code would be this. But Windows gives incorrect idChild, always 1. Therefore we don't know what icon has been added.
Macro Macro1708
Other option - find the icon as accessible object, and wait. To create code, use dialog "Find accessible object"; it's in the floating toolbar. But it uses CPU while waiting; on my PC 4.5%.
Macro Macro1710
Macro Macro1708
out
int hh=SetWinEventHook(EVENT_OBJECT_CREATE EVENT_OBJECT_CREATE 0 &sub.Hook_SetWinEventHook 0 0 WINEVENT_OUTOFCONTEXT)
if(!hh) end F"{ERR_FAILED}. {_s.dllerror}"
opt waitmsg 1
wait -1
UnhookWinEvent hh
#sub Hook_SetWinEventHook
function hHook event hwnd idObject idChild dwEventThread dwmsEventTime
;outw hwnd ;;debug
;out "%i %i" idObject idChild
if(idObject!=-4 or !WinTest(hwnd "ToolbarWindow32")) ret
_s.getwintext(hwnd); if(_s!="User Promoted Notification Area") ret
Acc a1.FromEvent(hwnd idObject idChild)
_s=a1.Name
out _s
Other option - find the icon as accessible object, and wait. To create code, use dialog "Find accessible object"; it's in the floating toolbar. But it uses CPU while waiting; on my PC 4.5%.
Macro Macro1710