how to close the vtkRenderWindow with program

I create a vtkRenderWindow and display image. when I click the ‘x’ icon on the top right ,the vtkRenderWindow can close. Now I want to know how can I close the window with program code.

Are you using Qt?

no, I am using MFC

Hello! Fortunately for me :slightly_smiling_face: my MFC days are gone long ago. Today I don’t know how to do it, but doing a little research, it seems that MFC is still not very intuitive as there are many ways to do it and some MFC method and WM_* message names are misleading: