c 2b 2b get cursor position console

Solutions on MaxInterview for c 2b 2b get cursor position console by the best coders in the world

showing results for - "c 2b 2b get cursor position console"
Nico
18 Feb 2017
1COORD GetConsoleCursorPosition(HANDLE hConsoleOutput)
2{
3    CONSOLE_SCREEN_BUFFER_INFO cbsi;
4    if (GetConsoleScreenBufferInfo(hConsoleOutput, &cbsi))
5    {
6        return cbsi.dwCursorPosition;
7    }
8    else
9    {
10        // The function failed. Call GetLastError() for details.
11        COORD invalid = { 0, 0 };
12        return invalid;
13    }
14}
15
Edoardo
26 Oct 2016
1POINT p;
2if (GetCursorPos(&p))
3{
4    //cursor position now in p.x and p.y
5}