当用户单击X按钮退出程序时,如何编写一个弹出对话框的编码? [英]How do I code a pop up dialog box to appear when the user clicks the X button to exit the program?