Click to See Complete Forum and Search --> : Message posted to window while aborting an application


shelly73
April 1st, 2003, 06:51 AM
Can someone tell me what message is posted to an application when the user presses Ctrl + C to terminate the application.
Regards,
Shelly.

NigelQ
April 1st, 2003, 09:48 PM
Which environment are you using - Ctrl+C doesn't terminate an application in windows ?

If you are describing a console based application, Ctrl+C is typically processed by a default interrupt handler.

This arrangement can be overridden using SetConsoleCtrlHandler in NT/2000

If you are describing ALT+F4 to close a window (and possibly an application) Windows posts a WM_SYSCOMMAND message to the window with SC_CLOSE as the WPARAM. This can be handled by the OnSysCommand message handler if it is derived from CWnd.

In a typical windows application, CTRL+C is used to copy data to the clipboard.

Hope this helps,

- Nigel