How to manualy enable/disable main window

I am working on a simulation, that requires to control visibility, or existence of the main window. I don’t mean hiding the window or simply disabling the “visible” option of the rendering.

Is there any way (either with blueprint or by adding extra code) to Enable or Disable the main window?