网站首页  词典首页

请输入您要查询的函数:

 

术语 createconsolescreenbuffer
释义 CreateConsoleScreenBuffer
语法:
C++
HANDLE WINAPI CreateConsoleScreenBuffer(
__in DWORD dwDesiredAccess,
__in DWORD dwShareMode,
__in_opt const SECURITY_ATTRIBUTES *lpSecurityAttributes,
__in DWORD dwFlags,
__reserved LPVOID lpScreenBufferData
);
CreateConsoleScreenBuffer Function
创建一个控制台屏幕缓冲区。
参数
dwDesiredAccess [in]
到控制台屏幕缓冲区访问。如需使用权名单,见控制台缓冲区安全和访问权限。
dwShareMode [in]
此参数可以是零,表明该缓冲区不能共享,也可以是一个或多个下列值。
ValueMeaning
FILE_SHARE_READ
0x00000001Other打开操作,可以在控制台上执行读访问屏幕缓冲区。
FILE_SHARE_WRITE
0x00000002Other公开操作能够在控制台上进行写访问屏幕缓冲区。
lpSecurityAttributes [中,可选]
一个 SECURITY_ATTRIBUTES结构,决定是否返回的句柄可以被继承的子进程的指针。如果lpSecurityAttributes为NULL,则句柄不能被继承。结构的lpSecurityDescriptor成员指定为新的控制台屏幕缓冲区安全描述符。 If lpSecurityAttributes is NULL, the console screen buffer gets a default security descriptor.在一个控制台屏幕缓冲区来自默认安全描述符的ACL或模拟的主要创造者的象征。
dwFlags [in]
在控制台屏幕缓冲区创建类型。唯一受支持的屏幕缓冲区类型是CONSOLE_TEXTMODE_BUFFER。
lpScreenBufferData
版权所有;应该为NULL。
返回值
如果函数成功,返回值是一个句柄到新的控制台屏幕缓冲区。
如果函数失败,返回值是INVALID_HANDLE_VALUE。为了获得更多错误信息,调用GetLastError。
备注
一个控制台可以有多个屏幕缓冲区,但只有一个活动屏幕缓冲区。无效的屏幕缓冲区可以访问的阅读和写作,但只有积极的显示屏幕缓冲区。为了使新的屏幕缓冲区的积极屏幕缓冲区,使用SetConsoleActiveScreenBuffer功能。
调用进程可以使用返回的任何处理函数,需要处理到控制台屏幕缓冲区,但须在指定的访问dwDesiredAccess参数的限制。
调用进程可以使用DuplicateHandle函数来创建一个重复的屏幕缓冲区处理原处理具有不同的访问或延续性。然而,DuplicateHandle不能用于创建一个重复的是一个不同的进程(通过继承除外)有效。
要关闭控制台屏幕缓冲区处理,使用CloseHandle函数。
实例
有关示例,请参见读,写汉字和属性块。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWincon.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
控制台函数
控制台屏幕缓冲区
CloseHandle
DuplicateHandle
GetConsoleScreenBufferInfo
SECURITY_ATTRIBUTES
SetConsoleActiveScreenBuffer
SetConsoleScreenBufferSize
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==CreateConsoleScreenBuffer Function
Creates a console screen buffer.
Syntax
C++
HANDLE WINAPI CreateConsoleScreenBuffer(
__in DWORD dwDesiredAccess,
__in DWORD dwShareMode,
__in_opt const SECURITY_ATTRIBUTES *lpSecurityAttributes,
__in DWORD dwFlags,
__reserved LPVOID lpScreenBufferData
);
Parameters
dwDesiredAccess [in]
The access to the console screen buffer. For a list of access rights, see Console Buffer Security and Access Rights .
dwShareMode [in]
This parameter can be zero, indicating that the buffer cannot be shared, or it can be one or more of the following values.
ValueMeaning
FILE_SHARE_READ
0x00000001Other open operations can be performed on the console screen buffer for read access.
FILE_SHARE_WRITE
0x00000002Other open operations can be performed on the console screen buffer for write access.

lpSecurityAttributes [in, optional]
A pointer to a SECURITY_ATTRIBUTES structure that determines whether the returned handle can be inherited by child processes. If lpSecurityAttributes is NULL, the handle cannot be inherited. The lpSecurityDescriptor member of the structure specifies a security descriptor for the new console screen buffer. If lpSecurityAttributes is NULL, the console screen buffer gets a default security descriptor. The ACLs in the default security descriptor for a console screen buffer come from the primary or impersonation token of the creator.
dwFlags [in]
The type of console screen buffer to create. The only supported screen buffer type is CONSOLE_TEXTMODE_BUFFER.
lpScreenBufferData
Reserved; should be NULL.
Return Value
If the function succeeds, the return value is a handle to the new console screen buffer.
If the function fails, the return value is INVALID_HANDLE_VALUE. To get extended error information, call GetLastError .
Remarks
A console can have multiple screen buffers but only one active screen buffer. Inactive screen buffers can be accessed for reading and writing, but only the active screen buffer is displayed. To make the new screen buffer the active screen buffer, use the SetConsoleActiveScreenBuffer function.
The calling process can use the returned handle in any function that requires a handle to a console screen buffer, subject to the limitations of access specified by the dwDesiredAccess parameter.
The calling process can use the DuplicateHandle function to create a duplicate screen buffer handle that has different access or inheritability from the original handle. However, DuplicateHandle cannot be used to create a duplicate that is valid for a different process (except through inheritance).
To close the console screen buffer handle, use the CloseHandle function.
Examples
For an example, see Reading and Writing Blocks of Characters and Attributes .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWincon.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
Console Functions
Console Screen Buffers
CloseHandle
DuplicateHandle
GetConsoleScreenBufferInfo
SECURITY_ATTRIBUTES
SetConsoleActiveScreenBuffer
SetConsoleScreenBufferSize
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms682122(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 13:24:01