To reuse the OnExit function for the Exit menu element, reopen the Menu Designer and
then reopen the Class Wizard. When the Class Wizard is displayed, add a function for
the IDM_FILE_EXIT object on the COMMAND event message. Do not accept the default
function name presented to you by the Class Wizard. Enter the function name OnExit.
This automatically attaches the existing OnExit function that you created with your Exit
button earlier.