BOOL WINAPI GenerateConsoleCtrlEvent( __in DWORD dwCtrlEvent, __in DWORD dwProcessGroupId );dwCtrlEvent The type of signal to be generated. This parameter can be one of the following values.Value Meaning
CTRL_C_EVENT 0 Generates a CTRL+C signal. This signal cannot be generated for process groups. If dwProcessGroupId is nonzero, this function will succeed, but the CTRL+C signal will not be received by processes within the specified process group.
CTRL_BREAK_EVENT 1 Generates a CTRL+BREAK signal. dwProcessGroupId The identifier of the process group to receive the signal. A process group is created when the CREATE_NEW_PROCESS_GROUP flag is specified in a call to the CreateProcess function. The process identifier of the new process is also the process group identifier of a new process group. The process group includes all processes that are descendants of the root process. Only those processes in the group that share the same console as the calling process receive the signal. In other words, if a process in the group creates a new console, that process does not receive the signal, nor do its descendants. If this parameter is zero, the signal is generated in all processes that share the console of the calling process.
BOOL WINAPI GenerateConsoleCtrlEvent(
__in DWORD dwCtrlEvent,
__in DWORD dwProcessGroupId
);dwCtrlEvent
The type of signal to be generated. This parameter can be one of the following values.Value Meaning
CTRL_C_EVENT
0
Generates a CTRL+C signal. This signal cannot be generated for process groups. If dwProcessGroupId is nonzero, this function will succeed, but the CTRL+C signal will not be received by processes within the specified process group.
CTRL_BREAK_EVENT
1
Generates a CTRL+BREAK signal.
dwProcessGroupId
The identifier of the process group to receive the signal. A process group is created when the CREATE_NEW_PROCESS_GROUP flag is specified in a call to the CreateProcess function. The process identifier of the new process is also the process group identifier of a new process group. The process group includes all processes that are descendants of the root process. Only those processes in the group that share the same console as the calling process receive the signal. In other words, if a process in the group creates a new console, that process does not receive the signal, nor do its descendants. If this parameter is zero, the signal is generated in all processes that share the console of the calling process.