Sadly, it does not allow the window to have a minimize button. But I can live with the fact that [X] minimizes my window to tray.
I did it using:
WhenClose=THISBACK(Hide);
To actually close the program, I have a right-click menu in the tray icon with an exit option.
First I tried
bar.Add(t_("Exit"), THISBACK(Close));
nothing happened. Then I created an own method, which called close:
bar.Add(t_("Exit"), THISBACK(closeProgram));
with
void closeProgram(){Close();}
being a method of my main window. Nothing happened. Then I tried Break() instead of Close(). Now it works. I dont know why close doesnt. (Close also does not minimize the window, so the problem is not that I changed the WhenClose thingy).