void ConsoleWnd::OnClose (BOOL &cancel) { // hide the console window without destroying the handle. This keeps the // messages alive in the window. cancel = TRUE; this->Hide (); // tell the main window to update its UI when the console window is closed. // For e.g. the main window will uncheck the View > Console menu item. _mainWindow.UpdateUI (); }