Navigation:  Programming Cookbook > Creating Console Applications >

Intercepting Console Control Commands

Previous pageReturn to chapter overviewNext page

Should the user attempt to close the console window in which an application is running, or if they press Ctrl+C or Ctrl+Break, then the session manager will receive an #onConsoleCtrl: message. The default implementation of this in SessionManager treats forwards Ctrl+C and Ctrl+Break actions as #onUserBreak messages, and close actions as #onCloseConsole messages.

The default implementation of #onCloseConsole in ConsoleSessionManager responds to an attempt to close the console window by terminating the application.