{{{1}}}
{{{2}}}
Correction: If the window is closed, it is #menuButton that returns CLOSED, not #menuRes.