Group: Console - Library: kernel32
The WriteConsole function writes a character string to a console screen buffer beginning at the current cursor location.
Saying "Hello World!" with VFP and WinAPI
Creating a console window for Visual FoxPro application
BOOL WriteConsole(
HANDLE hConsoleOutput,
const VOID* lpBuffer,
DWORD nNumberOfCharsToWrite,
LPDWORD lpNumberOfCharsWritten,
LPVOID lpReserved
);
DECLARE INTEGER WriteConsole IN kernel32;
INTEGER hConsoleOutput,;
STRING @ lpBuffer,;
INTEGER nNumberOfCharsToWrite,;
INTEGER @ lpNumberOfCharsWritten,;
INTEGER lpReserved
hConsoleOutput [in] Handle to the console screen buffer.
lpBuffer [in] Pointer to a buffer that contains characters to be written to the console screen buffer.
nNumberOfCharsToWrite [in] Number of TCHARs to write.
lpNumberOfCharsWritten [out] Pointer to a variable that receives the number of TCHARs actually written.
lpReserved Reserved; must be NULL.
If the function succeeds, the return value is nonzero.
The total size of the buffer must be less than 64K.
Use GetStdHandle with STD_OUTPUT_HANDLE to obtain the handle to the console screen buffer. Also you may create a screen buffer and attach it to the console.
See also: GetConsoleScreenBufferInfo, ReadConsole, SetConsoleCP, SetConsoleCursorPosition, SetConsoleTextAttribute, WriteFile.