网站首页  词典首页

请输入您要查询的函数:

 

术语 generateconsolectrlevent
释义 GenerateConsoleCtrlEvent
语法:
C++
BOOL WINAPI GenerateConsoleCtrlEvent(
__in DWORD dwCtrlEvent,
__in DWORD dwProcessGroupId
);
GenerateConsoleCtrlEvent功能
指定的信号发送到控制台进程组共用控制台调用进程有关。
参数
dwCtrlEvent [in]
该类型的信号产生。此参数可以是下列值之一。
ValueMeaning
CTRL_C_EVENT
0Generates了CTRL + C信号。这个信号不能生成过程组。如果dwProcessGroupId不为零,这个函数会成功,但按Ctrl + C信号不会被进程内收到指定的进程组。
CTRL_BREAK_EVENT
1Generates一按Ctrl + Break信号。
dwProcessGroupId [in]
这一进程的组标识符接收信号。一个进程组时创建CREATE_NEW_PROCESS_GROUP标志在指定调用CreateProcess函数。新的进程的进程标识,也是一个新的进程组进程组标识。该进程组包括所有进程的根进程的后裔。只有那些在小组进程共享相同的控制台调用过程中接受信号。换句话说,如果一个组中的过程将创建一个新的控制台,这一进程没有收到信号,也没有它的后代。
如果此参数为0,信号产生的所有进程共享的控制台调用进程。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
备注
GenerateConsoleCtrlEvent原因的过程控制在目标群体处理被调用的函数。所有的控制台进程的默认处理函数调用ExitProcess函数。一个控制台程序可以使用SetConsoleCtrlHandler函数来安装或删除等处理功能。
SetConsoleCtrlHandler还可以启用可继承属性导致调用进程忽略CTRL + C键信号。如果GenerateConsoleCtrlEvent发送了CTRL + C信号,此属性的启用,为这一进程的处理函数不叫的过程。按Ctrl + Break信号始终导致处理函数被调用。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWincon.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
控制台控制处理程序
控制台函数
CreateProcess的
PRB:ExitProcess期间
SetConsoleCtrlHandler
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==GenerateConsoleCtrlEvent Function
Sends a specified signal to a console process group that shares the console associated with the calling process.
Syntax
C++
BOOL WINAPI GenerateConsoleCtrlEvent(
__in DWORD dwCtrlEvent,
__in DWORD dwProcessGroupId
);
Parameters
dwCtrlEvent [in]
The type of signal to be generated. This parameter can be one of the following values.
ValueMeaning
CTRL_C_EVENT
0Generates 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
1Generates a CTRL+BREAK signal.

dwProcessGroupId [in]
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.
Return Value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError .
Remarks
GenerateConsoleCtrlEvent causes the control handler functions of processes in the target group to be called. All console processes have a default handler function that calls the ExitProcess function. A console process can use the SetConsoleCtrlHandler function to install or remove other handler functions.
SetConsoleCtrlHandler can also enable an inheritable attribute that causes the calling process to ignore CTRL+C signals. If GenerateConsoleCtrlEvent sends a CTRL+C signal to a process for which this attribute is enabled, the handler functions for that process are not called. CTRL+BREAK signals always cause the handler functions to be called.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWincon.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
Console Control Handlers
Console Functions
CreateProcess
ExitProcess
SetConsoleCtrlHandler
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms683155(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 11:22:21