术语 | readconsoleinput |
释义 | ReadConsoleInput 语法: C++ BOOL WINAPI ReadConsoleInput( __in HANDLE hConsoleInput, __out PINPUT_RECORD lpBuffer, __in DWORD nLength, __out LPDWORD lpNumberOfEventsRead ); ReadConsoleInput功能 读取从控制台输入缓冲区的数据,并移除它从缓冲区。 参数 hConsoleInput [in] 句柄到控制台输入缓冲区。句柄必须有GENERIC_READ访问的权利。有关更多信息,参见控制台缓冲区安全和访问权限。 lpBuffer [out] 一个一个INPUT_RECORD结构的数组,它接收输入缓冲区数据指针。在将小于64K的要求阵列的总规模。 nLength [in] 数组的大小指向的lpBuffer参数,在数组元素。 lpNumberOfEventsRead [out] 一个变量,它接收的输入读取记录数的指针。 返回值 如果函数成功,返回值为非零。 如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。 备注 如果在nLength参数要求的记录数超过了缓冲区中的记录数目,可用数字读取。该函数不会返回,直到至少一个输入的记录已被读取。 一个进程可以指定一个控制台输入缓冲区的处理函数来确定等待当有未读的控制台输入之一。当输入缓冲区不为空,在控制台输入缓冲区处理国家发出信号。 要确定在控制台的输入缓冲器,使用GetNumberOfConsoleInputEvents未读输入记录的函数。读取控制台不影响读输入缓冲区中的记录数,使用PeekConsoleInput函数的输入记录。放弃在控制台的输入缓冲器,使用FlushConsoleInputBuffer函数所有未读的记录。 此函数使用任何Unicode字符或8位字符从控制台的当前代码页。控制台的代码页默认最初系统的OEM代码页。要更改控制台的代码页,使用SetConsoleCP或SetConsoleOutputCP功能,或使用chcp处长或节能模式选择=命令。 实例 有关示例,请参见读输入缓冲区事件。 要求: 最低支持:client-Windows 2000专业版 最低支持server-Windows 2000服务器 HeaderWincon.h(头文件:winuser.h) LibraryKernel32.lib DLLKernel32.dll Unicode和ANSI namesReadConsoleInputW(Unicode)和ReadConsoleInputA(ANSI)的 参见 控制台函数 FlushConsoleInputBuffer GetNumberOfConsoleInputEvents INPUT_RECORD 低级别控制台输入功能 PeekConsoleInput ReadConsole ReadFile SetConsoleCP SetConsoleOutputCP WriteConsoleInput 如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com) 生成日期:2009年8月27日 ==英文原文==ReadConsoleInput Function Reads data from a console input buffer and removes it from the buffer. Syntax C++ BOOL WINAPI ReadConsoleInput( __in HANDLE hConsoleInput, __out PINPUT_RECORD lpBuffer, __in DWORD nLength, __out LPDWORD lpNumberOfEventsRead ); Parameters hConsoleInput [in] A handle to the console input buffer. The handle must have the GENERIC_READ access right. For more information, see Console Buffer Security and Access Rights . lpBuffer [out] A pointer to an array of INPUT_RECORD structures that receives the input buffer data. The total size of the array required will be less than 64K. nLength [in] The size of the array pointed to by the lpBuffer parameter, in array elements. lpNumberOfEventsRead [out] A pointer to a variable that receives the number of input records read. 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 If the number of records requested in the nLength parameter exceeds the number of records available in the buffer, the number available is read. The function does not return until at least one input record has been read. A process can specify a console input buffer handle in one of the wait functions to determine when there is unread console input. When the input buffer is not empty, the state of a console input buffer handle is signaled. To determine the number of unread input records in a console's input buffer, use the GetNumberOfConsoleInputEvents function. To read input records from a console input buffer without affecting the number of unread records, use the PeekConsoleInput function. To discard all unread records in a console's input buffer, use the FlushConsoleInputBuffer function. 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 Input Buffer Events . Requirements Minimum supported clientWindows 2000 Professional Minimum supported serverWindows 2000 Server HeaderWincon.h (include Windows.h) LibraryKernel32.lib DLLKernel32.dll Unicode and ANSI namesReadConsoleInputW (Unicode) and ReadConsoleInputA (ANSI) See Also Console Functions FlushConsoleInputBuffer GetNumberOfConsoleInputEvents INPUT_RECORD Low-Level Console Input Functions PeekConsoleInput ReadConsole ReadFile SetConsoleCP SetConsoleOutputCP WriteConsoleInput Send comments about this topic to Microsoft Build date: 8/27/2009 ==原始网址==http://msdn.microsoft.com/en-us/library/ms684961(VS.85).aspx\n |
随便看 |
|
windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。