Answers for "How to get cursor position c++"

C++
1

c++ get cursor position console

COORD GetConsoleCursorPosition(HANDLE hConsoleOutput)
{
    CONSOLE_SCREEN_BUFFER_INFO cbsi;
    if (GetConsoleScreenBufferInfo(hConsoleOutput, &cbsi))
    {
        return cbsi.dwCursorPosition;
    }
    else
    {
        // The function failed. Call GetLastError() for details.
        COORD invalid = { 0, 0 };
        return invalid;
    }
}
Posted by: Guest on September-12-2021
1

How to get cursor position c++

POINT p;
if (GetCursorPos(&p))
{
    //cursor position now in p.x and p.y
}
Posted by: Guest on August-09-2021

Code answers related to "How to get cursor position c++"

Browse Popular Code Answers by Language