Forgot to say, that the script was only executing cli params, when tray minned.
To solve it, I replaced:
Local hWnd = Win.Handle("+Foobar2000")
Local hToolBar = Win.ChildHandleList(hWnd, sCUI)
hToolBar = Win.ChildHandleList(hWnd, sDUI)
with:
Local hWnd_C = win.Handle("c={E7076D1C-A7BF-4f39-B771-BCBE88F2A2A8}")
Local hWnd_D = win.Handle("c={97E27FAA-C0B3-4b8e-A693-ED7881E99FC1}")
Local hToolBar = Win.ChildHandleList(hWnd_C, sCUI)
hToolBar = Win.ChildHandleList(hWnd_D, sDUI)
now it works even if it's tray minned.