I've thought they are definitly same.
But I just found some values CTRL_C_EVENT and CTRL_BREAK_EVENT at SetConsoleCtrlhandler function.
Is there a difference?
(ConTRoL-Break) In a Windows PC, holding down the Ctrl key and pressing the Break key cancels the running program or batch file. See Ctrl-C.
Alternatively referred to as Control+C, ^c, and C-c, Ctrl+C is a keyboard shortcut used to copy highlighted text or other object to the clipboard in a graphical user environment.
The CTRL+C key breaks into the debugger, stopping the target application or target computer, and cancels debugger commands.
By default, when a console window has the keyboard focus, CTRL + C or CTRL + BREAK is treated as a signal (SIGINT or SIGBREAK) and not as keyboard input.
See the official documentation here: CTRL+C and CTRL+BREAK Signals
I quote:
CTRL+BREAK is always treated as a signal, but an application can change the default CTRL+C behavior in two ways that prevent the handler functions from being called
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With