网站首页  词典首页

请输入您要查询的函数:

 

术语 allocconsole
释义 AllocConsole
语法:
C++
BOOL WINAPI AllocConsole(void);
AllocConsole功能
分配一个新的控制台调用进程。
参数
这个函数没有参数。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
备注
一个进程可以与只有一个控制台,因此AllocConsole函数失败如果调用进程已经有一个控制台。一个进程可以使用FreeConsole函数摆脱目前的主机,那么它可以调用AllocConsole创建一个新的控制台或AttachConsole附加到另一台主机。
如果调用过程将创建一个子进程,孩子继承新的控制台。
AllocConsole初始化标准输入,标准输出和标准错误处理的新的控制台。标准输入句柄是一个句柄控制台输入缓冲区,标准输出和标准错误句柄句柄控制台的屏幕缓冲区。要检索这些句柄,使用GetStdHandle函数。
这个功能主要是使用图形用户界面(GUI)的应用程序创建一个控制台窗口。 GUI应用程序的初始化没有控制台。控制台应用程序初始化一个控制台,除非它们作为独立进程创建(通过调用DETACHED_PROCESS旗CreateProcess函数)。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWincon.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
控制台函数
控制台
AttachConsole
CreateProcess的
FreeConsole
GetStdHandle
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==AllocConsole Function
Allocates a new console for the calling process.
Syntax
C++
BOOL WINAPI AllocConsole(void);
Parameters
This function has no parameters.
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 associated with only one console, so the AllocConsole function fails if the calling process already has a console. A process can use the FreeConsole function to detach itself from its current console, then it can call AllocConsole to create a new console or AttachConsole to attach to another console.
If the calling process creates a child process, the child inherits the new console.
AllocConsole initializes standard input, standard output, and standard error handles for the new console. The standard input handle is a handle to the console's input buffer, and the standard output and standard error handles are handles to the console's screen buffer. To retrieve these handles, use the GetStdHandle function.
This function is primarily used by graphical user interface (GUI) application to create a console window. GUI applications are initialized without a console. Console applications are initialized with a console, unless they are created as detached processes (by calling the CreateProcess function with the DETACHED_PROCESS flag).
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWincon.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
Console Functions
Consoles
AttachConsole
CreateProcess
FreeConsole
GetStdHandle
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms681944(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:36