Skip to content

Latest commit

 

History

History
72 lines (49 loc) · 1.44 KB

ReadConsole.md

File metadata and controls

72 lines (49 loc) · 1.44 KB

Home

Function name : ReadConsole

Group: Console - Library: kernel32


The ReadConsole function reads character input from the console input buffer and removes it from the buffer.


Code examples:

Creating a console window for Visual FoxPro application

Declaration:

BOOL ReadConsole(
  HANDLE hConsoleInput,
  LPVOID lpBuffer,
  DWORD nNumberOfCharsToRead,
  LPDWORD lpNumberOfCharsRead,
  LPVOID lpReserved
);  

FoxPro declaration:

DECLARE INTEGER ReadConsole IN kernel32;
	INTEGER   hConsoleInput,;
	STRING  @ lpBuffer,;
	INTEGER   nNumberOfCharsToRead,;
	INTEGER @ lpNumberOfCharsRead,;
	INTEGER   lpReserved
  

Parameters:

hConsoleInput [in] Handle to the console input buffer.

lpBuffer [out] Pointer to a buffer that receives the data read from the console input buffer.

nNumberOfCharsToRead [in] Number of TCHARs to read.

lpNumberOfCharsRead [out] Pointer to a variable that receives the number of TCHARs actually read.

lpReserved [in] Reserved; must be NULL.


Return value:

If the function succeeds, the return value is nonzero.


Comments:

The total size of the buffer required will be less than 64K.

Use GetStdHandle with STD_INPUT_HANDLE to obtain the handle to the console input buffer.

See also: WriteConsole.