网站首页  词典首页

请输入您要查询的函数:

 

术语 writeconsoleoutput
释义 WriteConsoleOutput
语法:
C++
BOOL WINAPI WriteConsoleOutput(
__in HANDLE hConsoleOutput,
__in const CHAR_INFO *lpBuffer,
__in COORD dwBufferSize,
__in COORD dwBufferCoord,
__inout PSMALL_RECT lpWriteRegion
);
WriteConsoleOutput功能
写字符和颜色属性数据到指定的字符单元矩形块在控制台屏幕缓冲区。要写入的数据是由一个相应大小为在指定的位置源缓冲区矩形块。
参数
hConsoleOutput [in]
句柄到控制台屏幕缓冲区。句柄必须有GENERIC_WRITE访问权限。有关更多信息,参见控制台缓冲区安全和访问权限。
lpBuffer [in]
这些数据被写入到控制台屏幕缓冲区。该指针将被视为对一两个来源的CHAR_INFO的大小是由dwBufferSize参数指定的结构维数组。数组的总大小必须小于64K的。
dwBufferSize [in]
缓冲区的大小指向的lpBuffer参数,细胞的性质。该坐标结构X成员的列数;的Y成员的行数。
dwBufferCoord [in]
在缓冲区中的左上角单元格坐标指向的lpBuffer参数。该坐标结构X成员是列,和Y成员行。
lpWriteRegion [ in , out ]
一个 SMALL_RECT结构的指针。在输入,结构成员指定的左上角和右下角的控制台屏幕缓冲区的矩形写入坐标。在输出的结构成员指定实际采用矩形。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
备注
WriteConsoleOutput对待源缓冲区,并为二维数组(列和行的目的地字符单元屏幕缓冲区)。该矩形指向的lpWriteRegion参数指定的大小和位置的块写入到控制台屏幕缓冲区。一个同样大小的矩形位于其上,离开了在lpBuffer阵列dwBufferCoord参数坐标细胞。从细胞,在这个矩形的交汇点,矩形数据源缓冲区(其尺寸指定的dwBufferSize参数)写入到目标矩形。
在目标矩形源的位置,其相应的细胞外源缓冲区的边界矩形剩下的写操作的影响。换句话说,这些都是细胞,这些地区没有数据来写。
前WriteConsoleOutput回报,台lpWriteRegion成员的实际屏幕缓冲区的矩形的写操作的影响。这反映了矩形目标矩形的细胞是存在的,在相应的单元格源缓冲区,因为WriteConsoleOutput剪辑目标矩形的尺寸的控制台屏幕缓冲区的边界。
如果lpWriteRegion指定的矩形是完全超出了控制台屏幕缓冲区,或者相应的矩形定位外源缓冲区的边界完全没有数据写入的界限。在这种情况下,同结构的成员函数返回指出的lpWriteRegion参数来设置,例如,正确的成员比左,或底部的成员少比前少。要确定控制台屏幕缓冲区,使用GetConsoleScreenBufferInfo功能的大小。
WriteConsoleOutput不会对光标位置的影响。
此函数使用任何Unicode字符或8位字符从控制台的当前代码页。控制台的代码页默认最初系统的OEM代码页。要更改控制台的代码页,使用SetConsoleCP或SetConsoleOutputCP功能,或使用chcp处长或节能模式选择=命令。
实例
有关示例,请参见读,写汉字和属性块。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWincon.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode和ANSI namesWriteConsoleOutputW(Unicode)和WriteConsoleOutputA(ANSI)的
参见
控制台函数
CHAR_INFO
COORD
GetConsoleScreenBufferInfo
低级别控制台输出函数
ReadConsoleOutput
ReadConsoleOutputAttribute
ReadConsoleOutputCharacter
SetConsoleCP
SetConsoleOutputCP
SMALL_RECT
WriteConsoleOutputAttribute
WriteConsoleOutputCharacter
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==WriteConsoleOutput Function
Writes character and color attribute data to a specified rectangular block of character cells in a console screen buffer. The data to be written is taken from a correspondingly sized rectangular block at a specified location in the source buffer.
Syntax
C++
BOOL WINAPI WriteConsoleOutput(
__in HANDLE hConsoleOutput,
__in const CHAR_INFO *lpBuffer,
__in COORD dwBufferSize,
__in COORD dwBufferCoord,
__inout PSMALL_RECT lpWriteRegion
);
Parameters
hConsoleOutput [in]
A handle to the console screen buffer. The handle must have the GENERIC_WRITE access right. For more information, see Console Buffer Security and Access Rights .
lpBuffer [in]
The data to be written to the console screen buffer. This pointer is treated as the origin of a two-dimensional array of CHAR_INFO structures whose size is specified by the dwBufferSize parameter. The total size of the array must be less than 64K.
dwBufferSize [in]
The size of the buffer pointed to by the lpBuffer parameter, in character cells. The X member of the COORD structure is the number of columns; the Y member is the number of rows.
dwBufferCoord [in]
The coordinates of the upper-left cell in the buffer pointed to by the lpBuffer parameter. The X member of the COORD structure is the column, and the Y member is the row.
lpWriteRegion [in, out]
A pointer to a SMALL_RECT structure. On input, the structure members specify the upper-left and lower-right coordinates of the console screen buffer rectangle to write to. On output, the structure members specify the actual rectangle that was used.
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
WriteConsoleOutput treats the source buffer and the destination screen buffer as two-dimensional arrays (columns and rows of character cells). The rectangle pointed to by the lpWriteRegion parameter specifies the size and location of the block to be written to in the console screen buffer. A rectangle of the same size is located with its upper-left cell at the coordinates of the dwBufferCoord parameter in the lpBuffer array. Data from the cells that are in the intersection of this rectangle and the source buffer rectangle (whose dimensions are specified by the dwBufferSize parameter) is written to the destination rectangle.
Cells in the destination rectangle whose corresponding source location are outside the boundaries of the source buffer rectangle are left unaffected by the write operation. In other words, these are the cells for which no data is available to be written.
Before WriteConsoleOutput returns, it sets the members of lpWriteRegion to the actual screen buffer rectangle affected by the write operation. This rectangle reflects the cells in the destination rectangle for which there existed a corresponding cell in the source buffer, because WriteConsoleOutput clips the dimensions of the destination rectangle to the boundaries of the console screen buffer.
If the rectangle specified by lpWriteRegion lies completely outside the boundaries of the console screen buffer, or if the corresponding rectangle is positioned completely outside the boundaries of the source buffer, no data is written. In this case, the function returns with the members of the structure pointed to by the lpWriteRegion parameter set such that the Right member is less than the Left, or the Bottom member is less than the Top. To determine the size of the console screen buffer, use the GetConsoleScreenBufferInfo function.
WriteConsoleOutput has no effect on the cursor position.
This function uses either Unicode characters or 8-bit characters from the console's current code page. The console's code page defaults initially to the system's OEM code page. To change the console's code page, use the SetConsoleCP or SetConsoleOutputCP functions, or use the chcp or mode con cp select= commands.
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
Unicode and ANSI namesWriteConsoleOutputW (Unicode) and WriteConsoleOutputA (ANSI)
See Also
Console Functions
CHAR_INFO
COORD
GetConsoleScreenBufferInfo
Low-Level Console Output Functions
ReadConsoleOutput
ReadConsoleOutputAttribute
ReadConsoleOutputCharacter
SetConsoleCP
SetConsoleOutputCP
SMALL_RECT
WriteConsoleOutputAttribute
WriteConsoleOutputCharacter
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms687404(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:30:42