网站首页  词典首页

请输入您要查询的函数:

 

术语 attachconsole
释义 AttachConsole
语法:
C++
BOOL WINAPI AttachConsole(
__in DWORD dwProcessId
);
AttachConsole功能
重视调用进程的控制台指定的进程。
参数
dwProcessId [in]
该进程标识符的主机使用。此参数可以是下列值之一。
ValueMeaning
pidUse的控制台指定进程。
ATTACH_PARENT_PROCESS
(DWORD值),1Use的控制台当前进程的父。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
备注
一个进程可以附加到一个控制台最多。如果调用进程已经连接到控制台,返回错误代码为ERROR_ACCESS_DENIED(5)。如果指定的进程没有一个控制台,错误代码返回出现ERROR_INVALID_HANDLE(6)。如果指定的进程不存在,错误代码返回ERROR_GEN_FAILURE(31)。
一个进程可以使用FreeConsole函数本身分离从控制台。如果其他进程共享的控制台,控制台不能被破坏,但这一进程的要求FreeConsole不能引用它。一个控制台关闭最后一个进程时附加的终止或呼叫FreeConsole。经过进程调用FreeConsole,它可以调用AllocConsole函数来创建一个新的控制台或AttachConsole附加到另一台主机。
要编译的应用程序使用此功能,定义_WIN32_WINNT为0x0501或更高版本。有关详细信息,请参阅使用Windows头。
要求:
最低支持client-Windows XP
最低支持serverWindows服务器2003
HeaderWincon.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
控制台函数
控制台
AllocConsole
FreeConsole
GetConsoleProcessList
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==AttachConsole Function
Attaches the calling process to the console of the specified process.
Syntax
C++
BOOL WINAPI AttachConsole(
__in DWORD dwProcessId
);
Parameters
dwProcessId [in]
The identifier of the process whose console is to be used. This parameter can be one of the following values.
ValueMeaning
pidUse the console of the specified process.
ATTACH_PARENT_PROCESS
(DWORD)-1Use the console of the parent of the current 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
A process can be attached to at most one console. If the calling process is already attached to a console, the error code returned is ERROR_ACCESS_DENIED (5). If the specified process does not have a console, the error code returned is ERROR_INVALID_HANDLE (6). If the specified process does not exist, the error code returned is ERROR_GEN_FAILURE (31).
A process can use the FreeConsole function to detach itself from its console. If other processes share the console, the console is not destroyed, but the process that called FreeConsole cannot refer to it. A console is closed when the last process attached to it terminates or calls FreeConsole. After a process calls FreeConsole, it can call the AllocConsole function to create a new console or AttachConsole to attach to another console.
To compile an application that uses this function, define _WIN32_WINNT as 0x0501 or later. For more information, see Using the Windows Headers .
Requirements
Minimum supported clientWindows XP
Minimum supported serverWindows Server 2003
HeaderWincon.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
Console Functions
Consoles
AllocConsole
FreeConsole
GetConsoleProcessList
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms681952(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:26:40