网站首页  词典首页

请输入您要查询的函数:

 

术语 getconsolemode
释义 GetConsoleMode
语法:
C++
BOOL WINAPI GetConsoleMode(
__in HANDLE hConsoleHandle,
__out LPDWORD lpMode
);
GetConsoleMode功能
检索控制台的输入缓冲区或控制台屏幕缓冲区的电流输出模式电流输入模式。
参数
hConsoleHandle [in]
句柄到控制台输入缓冲区或控制台屏幕缓冲区。句柄必须有GENERIC_READ访问的权利。有关更多信息,参见控制台缓冲区安全和访问权限。
lpMode [out]
一个变量,它接收指定缓冲区的当前模式的指针。
如果hConsoleHandle参数是一个输入句柄,该模式可以是一个或多个下列值。当创建一个控制台,除了ENABLE_WINDOW_INPUT所有输入模式默认情况下启用。
ValueMeaning
ENABLE_ECHO_INPUT
0x0004Characters宣读了ReadFile或ReadConsole功能被写入活动的屏幕缓冲区,因为他们看。这种模式可用于只有ENABLE_LINE_INPUT模式也启用。
ENABLE_INSERT_MODE
0x0020When启用,文字在控制台窗口将被插入在当前光标位置,该位置之后的所有文本将不会被覆盖输入。禁用时,所有下面的文本将被覆盖。
ENABLE_LINE_INPUT
0x0002The ReadFile或ReadConsole函数返回只有一个回车符读取。如果这个模式被禁用,函数返回时,一个或多个字符可用。
ENABLE_MOUSE_INPUT
0x0010If鼠标指针在控制台内的窗口和窗口具有键盘焦点的边界是,鼠标事件产生的鼠标移动和按键,在输入缓冲区内。这些事件是丢弃ReadFile或ReadConsole,即使这种模式已启用。
ENABLE_PROCESSED_INPUT
0x0001CTRL + C是由系统处理,而不是在输入缓冲区内。如果输入缓冲区是由ReadFile或ReadConsole,其他控制键读通过处理系统,而没有参与了ReadFile或ReadConsole缓冲区内。如果ENABLE_LINE_INPUT模式也已启用,退格,回车符和换行符由系统处理。
ENABLE_QUICK_EDIT_MODE
0x0040This标志使用户可以使用鼠标来选择和编辑文本。
ENABLE_WINDOW_INPUT
0x0008User相互作用,改变控制台屏幕缓冲区大小是在控制台输入缓冲区报告。有关这些事件可以读取输入缓冲区的应用程序使用的ReadConsoleInput功能,但不能使用ReadFile或ReadConsole的。
如果hConsoleHandle参数是屏幕缓冲区处理,该模式可以是一个或多个下列值。当屏幕缓冲区创建,两个输出模式默认情况下启用。
ValueMeaning
ENABLE_PROCESSED_OUTPUT
由WriteFile或WriteConsole职能了ReadFile或ReadConsole功能赞同或书面0x0001Characters被解析为ASCII控制序列,并正确执行操作。退格,制表符,钟,回车符和换行符处理。
ENABLE_WRAP_AT_EOL_OUTPUT
与WriteFile或WriteConsole或ReadFile或ReadConsole,光标移动到下一行的开头呼应0x0002When书面当它达到了当前行结束。这将导致在控制台窗口会自动滚动显示的行之外时,最后一排在窗口光标进展。它还会造成的控制台屏幕缓冲区,以滚动的内容(丢弃在控制台的屏幕缓冲区顶行)在以后的最后一行在控制台屏幕缓冲区光标进展。如果这个模式被禁用,行中的最后一个字符之后的任何字符覆盖。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
备注
一个控制台由输入缓冲器和一个或多个屏幕缓冲区。在控制台缓冲模式确定如何在控制台中输入或输出(I / O)的行为行动。其中一个标志常量是用于输入手柄,另一组是与屏幕缓冲区(输出)用于处理。设置一个屏幕缓冲区的输出模式不影响其他屏幕缓冲区的输出模式。
在ENABLE_LINE_INPUT和ENABLE_ECHO_INPUT模式只影响使用ReadFile进程或ReadConsole读取控制台的输入缓冲区。同样,ENABLE_PROCESSED_INPUT模式主要影响ReadFile和ReadConsole用户,但它也确定是否按Ctrl + C输入是输入缓冲区报告(将宣读ReadConsoleInput功能),或传递给应用程序定义的函数。
在ENABLE_WINDOW_INPUT和ENABLE_MOUSE_INPUT方式确定是否涉及用户交互的窗口大小和鼠标操作公布在输入缓冲区或丢弃。这些事件可以读取ReadConsoleInput,但他们总是被ReadFile和ReadConsole过滤。
在ENABLE_PROCESSED_OUTPUT和ENABLE_WRAP_AT_EOL_OUTPUT模式不仅影响进程或ReadConsole使用ReadFile和WriteFile或WriteConsole。
要更改控制台的I / O模式,调用SetConsoleMode功能。
实例
有关示例,请参见读输入缓冲区事件。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWincon.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
控制台函数
控制台模式
ReadConsole
ReadConsoleInput
ReadFile
SetConsoleMode
WriteConsole
WriteFile
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==GetConsoleMode Function
Retrieves the current input mode of a console's input buffer or the current output mode of a console screen buffer.
Syntax
C++
BOOL WINAPI GetConsoleMode(
__in HANDLE hConsoleHandle,
__out LPDWORD lpMode
);
Parameters
hConsoleHandle [in]
A handle to the console input buffer or the console screen buffer. The handle must have the GENERIC_READ access right. For more information, see Console Buffer Security and Access Rights .
lpMode [out]
A pointer to a variable that receives the current mode of the specified buffer.
If the hConsoleHandle parameter is an input handle, the mode can be one or more of the following values. When a console is created, all input modes except ENABLE_WINDOW_INPUT are enabled by default.
ValueMeaning
ENABLE_ECHO_INPUT
0x0004Characters read by the ReadFile or ReadConsole function are written to the active screen buffer as they are read. This mode can be used only if the ENABLE_LINE_INPUT mode is also enabled.
ENABLE_INSERT_MODE
0x0020When enabled, text entered in a console window will be inserted at the current cursor location and all text following that location will not be overwritten. When disabled, all following text will be overwritten.
ENABLE_LINE_INPUT
0x0002The ReadFile or ReadConsole function returns only when a carriage return character is read. If this mode is disabled, the functions return when one or more characters are available.
ENABLE_MOUSE_INPUT
0x0010If the mouse pointer is within the borders of the console window and the window has the keyboard focus, mouse events generated by mouse movement and button presses are placed in the input buffer. These events are discarded by ReadFile or ReadConsole , even when this mode is enabled.
ENABLE_PROCESSED_INPUT
0x0001CTRL+C is processed by the system and is not placed in the input buffer. If the input buffer is being read by ReadFile or ReadConsole , other control keys are processed by the system and are not returned in the ReadFile or ReadConsole buffer. If the ENABLE_LINE_INPUT mode is also enabled, backspace, carriage return, and linefeed characters are handled by the system.
ENABLE_QUICK_EDIT_MODE
0x0040This flag enables the user to use the mouse to select and edit text.
ENABLE_WINDOW_INPUT
0x0008User interactions that change the size of the console screen buffer are reported in the console's input buffer. Information about these events can be read from the input buffer by applications using the ReadConsoleInput function, but not by those using ReadFile or ReadConsole.

If the hConsoleHandle parameter is a screen buffer handle, the mode can be one or more of the following values. When a screen buffer is created, both output modes are enabled by default.
ValueMeaning
ENABLE_PROCESSED_OUTPUT
0x0001Characters written by the WriteFile or WriteConsole function or echoed by the ReadFile or ReadConsole function are parsed for ASCII control sequences, and the correct action is performed. Backspace, tab, bell, carriage return, and linefeed characters are processed.
ENABLE_WRAP_AT_EOL_OUTPUT
0x0002When writing with WriteFile or WriteConsole or echoing with ReadFile or ReadConsole, the cursor moves to the beginning of the next row when it reaches the end of the current row. This causes the rows displayed in the console window to scroll up automatically when the cursor advances beyond the last row in the window. It also causes the contents of the console screen buffer to scroll up (discarding the top row of the console screen buffer) when the cursor advances beyond the last row in the console screen buffer. If this mode is disabled, the last character in the row is overwritten with any subsequent characters.

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 console consists of an input buffer and one or more screen buffers. The mode of a console buffer determines how the console behaves during input or output (I/O) operations. One set of flag constants is used with input handles, and another set is used with screen buffer (output) handles. Setting the output modes of one screen buffer does not affect the output modes of other screen buffers.
The ENABLE_LINE_INPUT and ENABLE_ECHO_INPUT modes only affect processes that use ReadFile or ReadConsole to read from the console's input buffer. Similarly, the ENABLE_PROCESSED_INPUT mode primarily affects ReadFile and ReadConsole users, except that it also determines whether CTRL+C input is reported in the input buffer (to be read by the ReadConsoleInput function) or is passed to a function defined by the application.
The ENABLE_WINDOW_INPUT and ENABLE_MOUSE_INPUT modes determine whether user interactions involving window resizing and mouse actions are reported in the input buffer or discarded. These events can be read by ReadConsoleInput, but they are always filtered by ReadFile and ReadConsole.
The ENABLE_PROCESSED_OUTPUT and ENABLE_WRAP_AT_EOL_OUTPUT modes only affect processes using ReadFile or ReadConsole and WriteFile or WriteConsole .
To change a console's I/O modes, call SetConsoleMode function.
Examples
For an example, see Reading Input Buffer Events .
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 Modes
ReadConsole
ReadConsoleInput
ReadFile
SetConsoleMode
WriteConsole
WriteFile
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms683167(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:23:29