The SetConsoleCursorPosition function sets the cursor position in the specified console screen buffer.
BOOL SetConsoleCursorPosition(
HANDLE hConsoleOutput, // handle to console screen buffer
COORD dwCursorPosition // new cursor position coordinates
);
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.
The cursor position determines where characters written by the WriteFile or WriteConsole function, or echoed by the ReadFile or ReadConsole function, are displayed. To determine the current position of the cursor, use the GetConsoleScreenBufferInfo function.
If the new cursor position is not within the boundaries of the screen buffer's window, the window origin changes to make the cursor visible.
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in wincon.h.
Import Library: Use kernel32.lib.
Consoles and Character-Mode Support Overview, Console Functions, GetConsoleCursorInfo, GetConsoleScreenBufferInfo, ReadConsole, ReadFile, SetConsoleCursorInfo, WriteConsole, WriteFile