Closing all the windows

Welcome, adding or using a menu item in the Client Menu Bar might be a better option. The menu item opens a window.

Open the designer and open up the Client Event Scripts and find the Menubar option in the display of event script types. I attached a screenshot.