Is there a way to save a display window as file from C++ code just like clicking on File menu then Save As.